Page 1 of 1

can't find " with strpos

Posted: Sun May 20, 2007 2:00 pm
by psychotomus
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?

Posted: Sun May 20, 2007 2:13 pm
by volka

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 . '] = "');