Jump to content


Photo

question


  • Please log in to reply
3 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 20 April 2006 - 12:08 AM

what does the needle, and haystack mean in this function prototype.
string strstr ( string haystack, string needle)

string stristr ( string haystack, string needle)

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 insrtsnhere13

insrtsnhere13
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 20 April 2006 - 12:13 AM

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."

<?php
  $string= 'this is a string';
  echo stristr($string, 'a');
// outputs "a string"
?> 

basically, it searches the string for the first time that the 2nd value "needle" appears and then shows everything from that point on

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 20 April 2006 - 12:15 AM

thanks

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 insrtsnhere13

insrtsnhere13
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 20 April 2006 - 12:22 AM

glad to help




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users