faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

15 of 548 people (3%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

what is in_array

Mar 19th, 2008 22:30
ha mo, Edwin Chan, Wolfram Kriesing,


in_array searches your array and see if the specified string matches 
any entry of your array.
For example, if you have an array $arr that looks like this:
   $arr = array(
      "ABC",
      "CDE",
      "EFG"
   )
And you want to find if the string "CDE" is one of the entry in your 
$arr array, you use the following in_array statement:
   in_array("CDE",$arr); // this search $arr for "CDE"
If the string exists in $arr, in_array returns true, otherwise it 
return false.
For more information, you can visit:
http://www.php.net/in_array
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com