Friday, August 15, 2008

How to check if a array key exists in php - array_key_exists()

when writing code using arrays you'll probably found stuck on a situation where you loose track of array keys in a associate array, or maybe its random that you don't know if its there or not.


if (array_key_exists('key_name', $search_array))
{
echo "array key found";
}


Get Free Sinhala IT Learning Videos Kuppiya.com


Get custom programming done at GetAFreelancer.com!

No comments:

Post a Comment