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, ∼4237🔥, 0💬
Popular Posts:
What is the Azure AD v1.0 OpenID Metadata Document? Azure AD v1.0 OpenID Metadata Document is an onl...
How to create the Hello-3.0.epub package? I have all required files to create Hello-3.0.epub. To cre...
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...
Why I am getting "LNK1104: cannot open file 'MSCOREE.lib'" error when building a C++/CLI program? Vi...
How to add a new operation to an API on the Publisher Dashboard of an Azure API Management Service? ...