Ninjakreborn Posted April 20, 2006 Share Posted April 20, 2006 what does the needle, and haystack mean in this function prototype.string strstr ( string haystack, string needle) string stristr ( string haystack, string needle) Quote Link to comment Share on other sites More sharing options...
insrtsnhere13 Posted April 20, 2006 Share Posted April 20, 2006 if you search the manual for the function stristr"Returns all of haystack from the first occurrence of needle to the end. needle and haystack are examined in a case-insensitive manner."[code]<?php $string= 'this is a string'; echo stristr($string, 'a');// outputs "a string"?> [/code]basically, it searches the string for the first time that the 2nd value "needle" appears and then shows everything from that point on Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted April 20, 2006 Author Share Posted April 20, 2006 thanks Quote Link to comment Share on other sites More sharing options...
insrtsnhere13 Posted April 20, 2006 Share Posted April 20, 2006 glad to help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.