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, ∼2847🔥, 0💬
Popular Posts:
What is Azure API Management Developer Portal? Azure API Management Developer Portal is an Azure Web...
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...
How To Break a File Path Name into Parts in PHP? If you have a file name, and want to get different ...
How To Open Standard Output as a File Handle in PHP? If you want to open the standard output as a fi...
How to make application release build with Visual Studio 2017? If you want to make a final release b...