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 #183941 is a reply to message #183936] Wed, 27 November 2013 16:47 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 11/27/2013 5:11 AM, bill wrote:
> On 11/25/2013 4:36 PM, Jerry Stuckle wrote:
>> On 11/25/2013 11:12 AM, 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?
>>>
>>> bill
>>
>> How did you get the string in $progressNote? Did you set it
>> yourself, or was it possibly sourced from a web page?
>>
>> What do you get if you echo $progressNote?
>>
>>
> I create the progress note in another script that is POSTed to this one.
>
> looking at progress note tells me that is is as I said, actually, I
> copied it from the display of the debug statement:
>
> echo basename(__FILE__) . ": " . __LINE__ .
> ":progNote=>$progressNote<<br />";
>
> As it should work, and does not, I will spend more time on it tomorrow
> (when I have the time.
>
> thanks
>
> bill

OK, in that case you have the characters '\' and 'n'. In PHP,
"\n" is a newline character. You need to either escape the '\' as in
"\\n\\n", or use single quotes around your string, i.e. '\n\n'.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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 15:29:02 GMT 2024

Total time taken to generate the page: 0.07585 seconds