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, ∼4705🔥, 0💬
Popular Posts:
How To Break a File Path Name into Parts in PHP? If you have a file name, and want to get different ...
How to enter &amp; entity in '@(...)' expressions? If you want to enter the &amp; se...
How to install "C++/CLI Support" component in Visual Studio? I need to build my Visual Studio C++/CL...
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
Where can I download the EPUB 2.0 sample book "The Metamorphosis" by Franz Kafka? You can following ...