There does seem to be a "method to the madness" in the parameter order of PHP's built-in functions.
For array functions the order is (needle, haystack).
For string functions, the order is (haystack, needle).
Written by on May 19, 2011
There does seem to be a "method to the madness" in the parameter order of PHP's built-in functions.
For array functions the order is (needle, haystack).
For string functions, the order is (haystack, needle).
array_key_exists( mixed $key , array $search )
stripos ( string $haystack , string $needle [, int $offset = 0 ] )
Written by on July 1, 2009
Which is “better” for developing web apps – Ruby or PHP? I recently saw a question on LinkedIn which inspired me to add my two cents to the discussion…
The key difference in the languages (Ruby vs. PHP) are the level of “object-orientation,” and (obviously) syntax. Ruby was designed from the start (~1993) to be an object-oriented language (EVERYTHING is an object) while PHP was, until recently (v5.0 – 2004), a procedural language (an example would be PHP v4.x’s use of the class name as a method for initialization vs. PHP 5.x’s use of __construct). As a ...
Recent Comments