Jump to content

stripos and escape characters


DaPaki1

Recommended Posts

Hi all,

 

I got a problem and i'm stumped. I am using the strripos function to find the position of a string. For example, for finding this string:

Type</td><td valign="top" align=left>"

 

the following command worked great:

strripos($mystring, "Type</td><td valign=\"top\" align=left">

 

All I had to do was add the backslashes (\) before the quatation marks (").

 

But with this string:

Poster</td><td align="left" valign="top"><img src="

 

No matter what I try, it doesn't find it, although I'm sure its part of the string.  This command craps out:

strripos($mystring, "Poster</td><td align=\"left\"")

 

But this command works:

strripos($mystring, "Poster</td><td")

 

I narrowed it down to the " a" in the word "align" giving me the problems. What am I doing wrong? Please help. I'm sure its pretty simple. (I'm a PHP newbie)

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/42087-stripos-and-escape-characters/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.