I know I can use in_array() to check whether, say, 'orange' is in the
array; but how do I then find out which index 'orange' is at?
--
Tim Fountain ([EMAIL PROTECTED])
http://www.tfountain.co.uk/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
a test';
> if(preg_match("/(.*)test/",$mem,$matches)) {
> echo strlen($matches[1]);
> }
> Of course, if "test" occurs more than once then the above won't
> work, since regex's are "greedy"...
If you add a ? after the * then that'll mak
ment, storing the message in your array, e.g.:
$result = @mysql_connect('blah','blah','blah') or
some_error_function();
or I guess you could also do:
$result = @mysql_connect('blah','blah','blah');
if (!$result)
{
$error_array[] = mysql_error
3 matches
Mail list logo