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, 2614🔥, 0💬
Popular Posts:
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...
How to use the "forward-request" Policy Statement to call the backend service for an Azure API servi...
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...