FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Newline (cr/lf) in imagestring
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Newline (cr/lf) in imagestring [message #182416 is a reply to message #182414] Sat, 03 August 2013 22:47 Go to previous messageGo to previous message
Lew Pitcher is currently offline  Lew Pitcher
Messages: 60
Registered: April 2013
Karma:
Member
On Saturday 03 August 2013 17:53, in comp.lang.php, timstreater(at)greenbee(dot)net
wrote:

> In article <zyeLt.331254$0a4(dot)83683(at)fx06(dot)iad>,
> Lew Pitcher <lew(dot)pitcher(at)digitalfreehold(dot)ca> wrote:
>
>> On Saturday 03 August 2013 17:01, in comp.lang.php,
>> timstreater(at)greenbee(dot)net wrote:
>>
>>> In article <46kqv8d4tqhl15ripkbc1dfjb2m0tqvgtt(at)4ax(dot)com>,
>>> Ed Jay <edMbj(at)aes-intl(dot)com> wrote:
>>>
>>>> So...how do I produce cr/lf?
>>>
>>> $lf = chr (10);
>>> $cr = chr (13);
>>> $nl = $cr . $lf;
>>
>> Alternatively,
>>
>> $lf = chr (37);
>> $cr = chr (13);
>> $nl = $cr . $lf;
>>
>> or even
>>
>> $nl = chr (21);
>>
>> Control characters are very platform specific, don't you think?
>>
>>> Simples.
>>
>> Only if you restrict Ed's solution to the platform /you/ use.
>
> The OP asked for CR and LF, which is what I gave. 21 is NAK and 37 is %,
> according to:
>
> <http://www.asciitable.com>

He's using ASCII??

37 is Line Feed,
13 is Carriage Return, and
21 is New Line
in EBCDIC. And, PHP runs on EBCDIC machines.

Better to use '\r' for Carriage Return, and '\n' for Linefeed / Newline, or
PHP defined constant (iirc, $PHP_EOL), and let PHP decide which platform,
which characterset, and which codepoints to use.


Or, better still, use the proper function (in the OP's case, another call to
imagestring() ) to achieve the proper text alignment.

HTH
--
Lew Pitcher
"In Skills, We Trust"
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reading a file on same server
Next Topic: ini_get("memory_limit") returns an empty string
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Dec 19 18:14:07 GMT 2024

Total time taken to generate the page: 0.04558 seconds