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, 3468🔥, 0💬
Popular Posts:
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...
How to access URL template parameters from "context.Request.Matched Parameters"object in Azure API P...
How to extend json.JSONEncoder class? I want to encode other Python data types to JSON. If you encod...
Tools, FAQ, Tutorials: JSON Validator JSON-XML Converter XML-JSON Converter JSON FAQ/Tutorials Pytho...