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
Â
⇒Understanding PHP String Literals and Operations
⇒⇒PHP Tutorials
2016-10-13, 1130👍, 0💬
Popular Posts:
How to access URL template parameters from "context.Request.Matched Parameters"object in Azure API P...
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...
How To Pad an Array with the Same Value Multiple Times in PHP? If you want to add the same value mul...
How To Add Column Headers to a Table? If you want to add column headers to a table, you need to use ...
Where to find tutorials on how to Read and Write Files in PHP? A collection of tutorials to answer m...