[ create a new paste ] login | about

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

PHP, pasted on Sep 16:
1
2
3
4
5
6
7
8
9
<?php

    $arr=array();
    
    echo "The array is ", $arr ? 'full' : 'empty', ".\n";

    $label = array(0 => 'empty', 1 => 'full');

    echo "The array is ", $label[(bool)$arr], ".\n";


Output:
1
2
The array is empty.
The array is empty.


Create a new paste based on this one


Comments: