RE: [PHP] Checking $_POST var and stripping
| From: | Jay Blanchard | Date: | Mon, 24 Jul 2006 11:55:10 +0000 |
| Subject: | RE: [PHP] Checking $_POST var and stripping | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-239722@lists.php.net to get a copy of this message | ||
[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>";
}
}