note 50837 added to function.stripos

From: Date: Fri, 11 Mar 2005 08:12:35 +0000
Subject: note 50837 added to function.stripos
Groups: php.notes 
Request: Send a blank email to php-notes+get-86237@lists.php.net to get a copy of this message
$pos = strpos($mystring, $findme); // Notez l'utilisation de ===. Un simple == ne donnerait pas le résultat escompté // car la lettre 'a' est à la position 0 (la première). if ($pos === false) { echo "La chaîne '$findme' n'a pas été trouvée dans la chaîne '$mystring'"; } else { echo "La chaîne '$findme' a été trouvée dans la chaîne '$mystring'"; echo " et à la position $pos"; } ---- Manual Page -- http://www.php.net/manual/en/function.stripos.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50837 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50837&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50837&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50837&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50837&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50837&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50837&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86237) next »