Posted by drec on 10/02/66 11:51
I am trying to right an if statment using strpos to determine if the
string exists in the variable, however I seem to be getting the wrong
effect. Here is my script.
<?php
$dn = "ABC-DEF";
$pos = strpos( $dn, "ABC-DEF" );
if ( $pos != FALSE )
{
echo 'variable contains value';
}
else
{
echo ' variable does not contain value' ;
}
?>
It keeps returning does not contain value. I am kinda new to strpos,
any suggestions?
[Back to original message]
|