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

Home » Imported messages » comp.lang.php » finding newlines
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: finding newlines [message #183932 is a reply to message #183919] Tue, 26 November 2013 14:36 Go to previous messageGo to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
On 11/25/2013 11:32 AM, Christoph Michael Becker wrote:
> bill wrote:
>
>> I am trying to find the first line bread in a string
>> where string = "Hand Carried by Patient\n\nTo Whom It May
>> Concern:\n\nR...."
>>
>> This code does not work: $pos = strpos($progressNote,"\n\n");
>> it returns pos = false
>>
>> where do I err?
>
> Um, the code should work, if $progressNote does contain a *double*
> newline character. Have you confirmed that $progressNote indeed
> contains what you expect? You may try looking for a *single* newline
> character:
>
> $pos = strpos($progressNote, "\n");
>

the text above is the exact text I am searching.
The statement is:


$pos = stripos($progressNote,"\n\n");

echo basename(__FILE__) . ": " . __LINE__ . ":pos= $pos, first
string = >" . substr($progressNote, 0, $pos). "<<br />";
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Lan Pc Login time
Next Topic: Check if $_GET contains something other than what's allowed
Goto Forum:
  

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

Current Time: Fri Sep 20 13:41:21 GMT 2024

Total time taken to generate the page: 0.04900 seconds