note 89788 modified in function.strpos by danbrown

From: Date: Mon, 23 Mar 2009 18:06:38 +0000
Subject: note 89788 modified in function.strpos by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-152337@lists.php.net to get a copy of this message
routine to return -1 if there is no match for strpos <?php //instr function to mimic vb instr fucntion function InStr($haystack, $needle) { $pos=strpos($haystack, $needle); if ($pos !== false) { return $pos; } else { return -1; } } ?> --was-- routine to return -1 if there is no match for strpos //instr function to mimic vb instr fucntion function InStr($haystack, $needle) { $pos=strpos($haystack, $needle); if ($pos !== false) { return $pos; } else { return -1; } } http://php.net/manual/en/function.strpos.php

« previous php.notes (#152337) next »