PDA

View Full Version : stripos()


filburt1
05-12-2003, 10:47 PM
<a href="http://www.php.net/manual/en/function.stripos.php" target="_blank">http://www.php.net/manual/en/function.stripos.php</a>

Anybody know for sure in what version of PHP this function was introduced?

SiGmA_X
05-12-2003, 10:56 PM
This won't be much help, but it doesn't work in the normal release of PHP4.3.1 with the following configures:'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--enable-magic-quotes' '--with-mysql=/usr' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib' As PHP.net said, perhaps it is only in the CVS version?

filburt1
05-12-2003, 10:58 PM
I guess. It's an extremely useful function though, I hope it comes out soon.

SiGmA_X
05-13-2003, 11:51 PM
Sure sounds like it! If it's your own server, you could download the source from CVS and compile it.. Works well, normally :)

MUG
05-14-2003, 12:08 AM
Wouldn't

strpos(strtolower($haystack), strtolower($needle))

work just as well?

filburt1
05-14-2003, 12:09 AM
Yes but why do that when there's a function that does it internally (probably faster, too)?

Cyborg from DH
05-14-2003, 01:57 PM
so just do a

if (!function_exists('stripos'))
{
function stripos($haystack, $needle, $int_offset=NULL)
{
return strpos(strtolower($haystack), strtolower($needle), $int_offset);
}
}

filburt1
05-14-2003, 02:48 PM
I solved the problem a while back and I'm doing something like that. I'm just saying a built-in PHP way will undoubtedly be faster.

SiGmA_X
05-14-2003, 03:56 PM
So if you need the speed, re-compileing the CVS might be needed.. :)

filburt1
05-14-2003, 04:14 PM
I can't recompile on shared servers, let alone other people's servers...