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, ∼2719🔥, 0💬
Popular Posts:
What is Fabric CA (Certificate Authority)? Fabric CA (Certificate Authority) is a component of Hyper...
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How to add an API to an API product for internal testing on the Publisher Portal of an Azure API Man...
How To Open Standard Output as a File Handle in PHP? If you want to open the standard output as a fi...
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a si...