php Programming Glossary: is_array
How to search by key=>value in a multidimensional array in PHP http://stackoverflow.com/questions/1019076/how-to-search-by-key-value-in-a-multidimensional-array-in-php Code function search array key value results array if is_array array if isset array key array key value results array foreach.. results function search_r array key value results if is_array array return if array key value results array foreach array..
How can I find unused functions in a PHP project http://stackoverflow.com/questions/11532/how-can-i-find-unused-functions-in-a-php-project path for i 0 i count tokens i token tokens i if is_array token if token 0 T_FUNCTION continue i token tokens i if token.. path for i 0 i count tokens i token tokens i if is_array token if token 0 T_STRING continue if tokens i 1 continue functions..
Asynchronous PHP calls? http://stackoverflow.com/questions/124462/asynchronous-php-calls post_without_wait url params foreach params as key val if is_array val val implode ' ' val post_params key.' '.urlencode val post_string..
create ini file, write values in PHP http://stackoverflow.com/questions/1268378/create-ini-file-write-values-in-php elem content . . key. n foreach elem as key2 elem2 if is_array elem2 for i 0 i count elem2 i content . key2. . elem2 i.. key2. . elem2. n else foreach assoc_arr as key elem if is_array elem for i 0 i count elem i content . key2. . elem i . n..
php multi-dimensional array remove duplicate http://stackoverflow.com/questions/1861682/php-multi-dimensional-array-remove-duplicate single value. At the moment I have something like this if is_array array count array 0 foreach array as subarray duplicateEmail..
codeigniter multiple file upload http://stackoverflow.com/questions/1908247/codeigniter-multiple-file-upload set_error msg CI get_instance CI lang load 'upload' if is_array msg foreach msg as val msg CI lang line val FALSE val CI..
isset() and empty() make code ugly http://stackoverflow.com/questions/1960509/isset-and-empty-make-code-ugly you'll just have to check table php if empty foo is_array foo php foreach foo as bar tr ... tr php endforeach php else..
Multidimensional array iteration http://stackoverflow.com/questions/2207599/multidimensional-array-iteration traverse nodes echo node foreach nodes as node if is_array node traverse node else echo node node node echo node traverse.. ' node ' arr nodes while count arr 0 n array_shift arr if is_array n array_unshift arr null arr array_merge n arr s . ' node '..
Invalid argument supplied for foreach() http://stackoverflow.com/questions/2630013/invalid-argument-supplied-for-foreach most cleanest not sure if it's the most efficient mind if is_array values foreach values as value ... The reasons for my preference..
Is micro-optimization worth the time? http://stackoverflow.com/questions/3470990/is-micro-optimization-worth-the-time a work mate told me that there is a big difference in is_array array and array array array and I was like eh that's a pointless..
PHP array combinations http://stackoverflow.com/questions/3742506/php-array-combinations protected k 0 protected pos 0 function __construct s k if is_array s this s array_values s this n count this s else this s string.. r array for i 0 i this k i r this s this c i return is_array this s r implode '' r function next if this _next this pos..
in_array() and multidimensional array http://stackoverflow.com/questions/4128323/in-array-and-multidimensional-array foreach haystack as item if strict item needle item needle is_array item in_array_r needle item strict return true return false..
Parsing JSON file with PHP http://stackoverflow.com/questions/4343596/parsing-json-file-with-php SELF_FIRST foreach jsonIterator as key val if is_array val echo key n else echo key val n Output John status Wait..
How to check IF user has ALREADY liked the facebook page? http://stackoverflow.com/questions/7397724/how-to-check-if-user-has-already-liked-the-facebook-page public function userIsFan sr this getSignedRequest if sr is_array sr if array_key_exists 'page' sr return sr 'page' 'liked' 1..
How do I make an asynchronous GET request in PHP? http://stackoverflow.com/questions/962915/how-do-i-make-an-asynchronous-get-request-in-php curl_post_async url params foreach params as key val if is_array val val implode ' ' val post_params key.' '.urlencode val post_string..
|