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, ∼2601🔥, 0💬
Popular Posts:
How to detect errors occurred in the json_decode() call? You can use the following two functions to ...
What properties and functions are supported on http.client.HTTPResponse objects? If you get an http....
How To Change Text Fonts for Some Parts of a Paragraph? If you want to change text fonts or colors f...
What is EPUB 3.0 Metadata "dc:description" Element? EPUB 3.0 Metadata "dc:description" is an optiona...
Where Is the Submitted Form Data Stored in PHP? When a user submit a form on your Web server, user e...