RE: Checking $_POST var and stripping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Can anyone help with this ? its checking the $_POST and seeing if any of
the
items begin with answer_,
if the do it should remove it from the beginning and place it into
$value_new.. does not seem to work though...

foreach($_POST as $qid => $value) {

$findme = 'answer_';
     if(stripos($value, $findme)) {
         $value_new = ltrim($value);
         print "$value_new<br>";
     }

}
[/snip]

stripos should be strops and would look for a numeric value, not what
you want. You want strstr I believe

foreach($_POST as $qid => $value) {

$findme = 'answer_';
     if(strstr($value, $findme)) {
         $value_new = ltrim($value);
         print "$value_new<br>";
     }

}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux