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, 1595🔥, 0💬
Popular Posts:
How to use "xml-to-json" Azure API Policy Statement? The "xml-to-json" Policy Statement allows you t...
Where to find tutorials on OpenID? Here is a large collection of tutorials to answer many frequently...
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...
How to start Docker Daemon, "dockerd", on CentOS systems? If you have installed Docker on your CentO...
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...