|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-02-13 03:08 UTC] fred at observe dot co dot za
<?
$arg = '123';
// prints 123
echo "arg = $arg<br>\n";
// prints nothing
echo "is_array(arg) = ", is_array($arg), "<br>\n";
// prints 1
echo "arg[blah] = $arg[blah]<br>\n";
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 05:00:02 2025 UTC |
$string[...] and $string{...} both allow single character access to strings. the {} variant is recommended for PHP 4, but the older version using [] still works the indices inside [...] or {...} are interpreted as integers, strings are casted to integers, and (int)'blah' is zero, that's it