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, ∼4471🔥, 0💬
Popular Posts:
How to enter & sign in '@(...)' expressions? & signs can be entered in '@(...)' expr...
What is the "__init__()" class method? The "__init__()" class method is a special method that will b...
Where to get a real Atom XML example? You can follow this tutorial to get a real Atom XML example: 1...
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...
How to use 'choose ... when ..." policy statements to control execution flows? If you want to contro...