mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
- Changed example to use square brackets
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@260842 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8d023a05ad
commit
febcf0dd0f
1 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.16 $ -->
|
||||
<!-- $Revision: 1.17 $ -->
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.substr">
|
||||
<refnamediv>
|
||||
<refname>substr</refname>
|
||||
|
@ -125,11 +125,11 @@ echo substr('abcdef', 0, 8); // abcdef
|
|||
echo substr('abcdef', -1, 1); // f
|
||||
|
||||
// Accessing single characters in a string
|
||||
// can also be achieved using "curly braces"
|
||||
// can also be achieved using "square brackets"
|
||||
$string = 'abcdef';
|
||||
echo $string{0}; // a
|
||||
echo $string{3}; // d
|
||||
echo $string{strlen($string)-1}; // f
|
||||
echo $string[0]; // a
|
||||
echo $string[3]; // d
|
||||
echo $string[strlen($string)-1]; // f
|
||||
|
||||
?>
|
||||
]]>
|
||||
|
|
Loading…
Reference in a new issue