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, ∼2351🔥, 0💬
Popular Posts:
How to Install Docker Desktop 2.5.0 on Windows 10? You can follow this tutorial to Install Docker De...
Can Two Forms Be Nested? Can two forms be nested? The answer is no and yes: No. You can not nest two...
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
How to start Docker Daemon, "dockerd", on CentOS systems? If you have installed Docker on your CentO...
How To Move Uploaded Files To Permanent Directory in PHP? PHP stores uploaded files in a temporary d...