[PHP] Re: php equivalent to asp's instr()

2003-08-28 Thread David Cuddeback
Hi Chris, I've always used strstr() for this _exact_ same purpose and it's worked just fine. I find it much more useful as an InStr()-like function than for actually doing anything with the string it returns. You'll want to note that the parameter order is $haystack before $needle. That goes fo

[PHP] Re: php equivalent to asp's instr()

2003-08-27 Thread DvDmanDT
Hmm... Are you sure strpos doesn't work for you? Sure worked for me when I wanted something like that Otherwise, checkout following: http://se2.php.net/strings function instr($needle, $haystack,$case_sensitive=true) { return (($case_sensitive?strpos($needle,$haystack):stripos($needle,$haystack))!=