Bernie in HK
16th of April 2002 (Tue), 13:04
FYI...
I've been having problems with photo.php giving me an error message saying that "array_search" is undefined. I've queried this with my hosting provider (http://www.avidhosting.com) and have received the following work-around:
> This function will be supported in the next version of
> PHP which will be rolled out shortly. The server
> presently has 4.0.4pl1.
> Looking at the PHP.net site manual it gives this
> workaround.
>
> For those with php source of your code:
>
> function array_search($str, $vars)
> {
> foreach ($vars as $key => $val)
> {
> if ($val == $str)
> {
> return $key;
> }
> }
> }
I've tested the work-around and it works just fine. Hopefully, this may help some of you with the same problem.
Regards,
Bernie
I've been having problems with photo.php giving me an error message saying that "array_search" is undefined. I've queried this with my hosting provider (http://www.avidhosting.com) and have received the following work-around:
> This function will be supported in the next version of
> PHP which will be rolled out shortly. The server
> presently has 4.0.4pl1.
> Looking at the PHP.net site manual it gives this
> workaround.
>
> For those with php source of your code:
>
> function array_search($str, $vars)
> {
> foreach ($vars as $key => $val)
> {
> if ($val == $str)
> {
> return $key;
> }
> }
> }
I've tested the work-around and it works just fine. Hopefully, this may help some of you with the same problem.
Regards,
Bernie