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, ∼2292🔥, 0💬
Popular Posts:
How to create the Hello-3.0.epub package? I have all required files to create Hello-3.0.epub. To cre...
How to send an FTP request with the urllib.request.urlopen() function? If an FTP server supports ano...
How To Set session.gc_divisor Properly in PHP? As you know that session.gc_divisor is the frequency ...
How To Use an Array as a Queue in PHP? A queue is a simple data structure that manages data elements...
What is EPUB 2.0 Metadata "dc:creator" and "dc:contributor" elements? EPUB 2.0 Metadata "dc:creator"...