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, 3153🔥, 0💬
Popular Posts:
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
How to access Request body from "context.Request.Body" object in Azure API Policy? Request body is t...
How to add request query string Parameters to my Azure API operation 2017 version to make it more us...
What is Azure API Management Developer Portal Admin? The Developer Portal Admin is an Azure Web port...
Where to get a JSON.stringify() Example Code in JavaScript? Here is a good JSON.stringify() example ...