Help with ? and :



Can someone help me interpret this snippet?

printf("<p>The two arrays are %sidentical.</p>\n", $arr1 === $arr2 ? ''
: 'not ');

It is easy to see what it does. It compares two arrays and inserts
either a space or a "not" space in the template string.

The parts I don't understand are the "?" and the ":". I can find no
documentation anywhere of the "?" and the ":".

I have had trouble generally getting good documentation on printf() and
sprintf().

Thanks,

--Kenoli

Kenoli Oleari
Neighborhood Assemblies Network
kenoli@xxxxxxx
510-601-8217
http://www.horizonsofchange.com
http://www.sfnan.org

.



Relevant Pages

  • Re: [PHP] in_array() related problem
    ... I really forgot the old PHP4 way and thought PHP5 compares ... To not flooding the bug tracking system I hope ... >> arrays for a match, not to mention those are object properties, not ...
    (php.general)
  • Re: About vector.contains()
    ... in this case the objects in the Vector are arrays, ... default Object.equalsimplementation which compares identity. ... the equals() method of the objects in the ...
    (comp.lang.java.programmer)
  • Re: Can a simple a==b hang in and endless loop?
    ... Claudio Grondi wrote: ... > expect '==' to compare the 'pointers' to the arrays and not to iterate ... > over all elements of the lists. ... compares pointers. ...
    (comp.lang.python)
  • Re: Array[] from *ptr question
    ... > getpassfunction that returns a *ptr. ... > a snippet of the class created. ... In C, when used in a value context, arrays and pointers work in the same ...
    (comp.lang.c)
  • Re: HELP : LINUX TOP analysis query
    ... of arrays are defined). ... I won't try digging into the details of what top shows (which can get ... complicated to interpret), but I don't need to because your symptoms are ... memory corruption (from things like ...
    (comp.lang.fortran)