PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
psychotomus
Forum Contributor
Posts: 487 Joined: Fri Jul 11, 2003 1:59 am
Post
by psychotomus » Sun May 20, 2007 2:00 pm
i can't seem to find " with strpos
if tried
Code: Select all
$temp = strpos($_POST['txtData'], "screen_path[" . $i . "] = \"");
Code: Select all
$temp = strpos($_POST['txtData'], 'screen_path[' . $i . '] = "');
and
Code: Select all
$temp = strpos($_POST['txtData'], "screen_path[" . $i . "] = " . chr(34));
any ideas?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sun May 20, 2007 2:13 pm
Code: Select all
$_POST['txtData'] = 'xyzscreen_path[1] = "abc"';
$i = 1;
$temp = strpos($_POST['txtData'], 'screen_path[' . $i . '] = "');
var_dump($temp);prints
int(3) as expected. The problem must be somewhere else.
Please try
Code: Select all
echo "_POST['txtData']: ", htmlentities($_POST['txtData']), "<br />\n";
echo 'needle: screen_path[' . $i . '] = "', "<br />\n";
$temp = strpos($_POST['txtData'], 'screen_path[' . $i . '] = "');