Tools, FAQ, Tutorials:
Accessing a Specific Character in String in PHP
How To Access a Specific Character in a String?
✍: FYIcenter.com
Any character in a string can be accessed by a special string element expression:
Here is a PHP script example:
<?php
$string = 'It\'s Friday!';
echo "The first character is $string{0}\n";
echo "The first character is {$string{0}}\n";
?>
This script will print:
The first character is It's Friday!{0}
The first character is I
⇒ Assigning a New Character in a String in PHP
⇐ Including Array Elements in Double-Quoted Strings in PHP
2016-10-13, ∼4863🔥, 0💬
Popular Posts:
How to create a navigation file like navigation.xhtml for an EPUB 3.0 book? At least one navigation ...
How to convert JSON Objects to PHP Associative Arrays using the json_decode() function? Actually, JS...
Where to find tutorials on Microsoft Azure services? Here is a large collection of tutorials to answ...
How to enter &amp; entity in '@(...)' expressions? If you want to enter the &amp; se...
How to use the "find-and-replace" Policy Statement for an Azure API service operation? The "find-and...