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 #183922 is a reply to message #183918] Mon, 25 November 2013 21:18 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
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
^^^^^^^^^^^^^^
For some reason I read “tomato” there at first ;-)

> Concern:\n\nR...."
>
> This code does not work: $pos = strpos($progressNote,"\n\n");
> it returns pos = false

No, it does not:

$ php -r 'var_dump(strpos("Hand Carried by Patient\n\nTo Whom It May",
"\n\n"));'
int(23)

> where do I err?

$progressNote !== "Hand Carried by Patient\n\n…"

PHP’s string functions are tricky; when in doubt, RTFM.


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
[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: Sun Nov 24 03:10:11 GMT 2024

Total time taken to generate the page: 0.04396 seconds