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, ∼2161🔥, 0💬
Popular Posts:
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
Where to get a JSON.stringify() Example Code in JavaScript? Here is a good JSON.stringify() example ...
Can Two Forms Be Nested? Can two forms be nested? The answer is no and yes: No. You can not nest two...
How to access Query String parameters from "context.Request.Url.Que ry"object in Azure API Policy? Q...
What Is session_register() in PHP? session_register() is old function that registers global variable...