Tools, FAQ, Tutorials:
Assigning a New Character in a String in PHP
How To Assigning a New Character in a String?
✍: FYIcenter.com
The string element expression, $string{index}, can also be used at the left side of an assignment statement. This allows you to assign a new character to any position in a string. Here is a PHP script example:
<?php
$string = 'It\'s Friday?';
echo "$string\n";
$string{11} = '!';
echo "$string\n";
?>
This script will print:
It's Friday? It's Friday!
⇒ Concatenating Two Strings in PHP
⇐ Accessing a Specific Character in String in PHP
2016-10-13, ∼2848🔥, 0💬
Popular Posts:
How to Install Docker Desktop on Windows 10? You can follow this tutorial to Install Docker Desktop ...
How To Access a Specific Character in a String? Any character in a string can be accessed by a speci...
Where to find EPUB Sample Files? Here is a list of EPUB sample files collected by FYIcenter.com team...
How to add request body examples to my Azure API operation to make it more user friendly? If you hav...
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...