[ create a new paste ] login | about

Link: http://codepad.org/yBIVBHj0    [ raw code | output | fork ]

PHP, pasted on Feb 20:
1
2
3
4
5
6
7
8
<?php
$array = array(1,2,"");
foreach($array as $key => $value) {
    if (empty($value))
        echo "$key empty <br/>";
    else
        echo "$key not empty <br/>";
}


Output:
1
0 not empty <br/>1 not empty <br/>2 empty <br/>


Create a new paste based on this one


Comments: