You are here:
10 tips for PHP scripts: Learn to use PHP`s arrays
With PHP 4.0 comes more than 30 new array-related functions. Some of the more common functions let you determine if something is in a given array or not, count the number of elements in an array, add or delete array elements, and sort array elements.
If you have a large array and all you need to do is find out if a given value exists, you can use in_array() to return true or false. The following will print "Not found in this array" because you`re looking for "Albert" in the $namesArray, which does not exist.
Script Info:
10 tips for PHP scripts: Learn to use PHP`s arrays from Tips and Tutorials Scripts.http://builder.com.com/5100-31-5077722.html
|
||||||||
|
« Back to Tips and Tutorials
Comments
Only registered users can post comments!
Login
Featured
Sponsored
