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, ∼3997🔥, 0💬
Popular Posts:
How to Build my "sleep" Docker image from the Alpine image? I want the container to sleep for 10 hou...
How to dump (or encode, serialize) a Python object into a JSON string using json.dumps()? The json.d...
What is Azure API Management Gateway? Azure API Management Gateway is the Azure Web server that serv...
What is Azure API Management Publisher Dashboard? Azure API Management Publisher Dashboard is an Azu...
Where can I download the EPUB 2.0 sample book "The Problems of Philosophy" by Lewis Theme? You can f...