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, 1913🔥, 0💬
Popular Posts:
Where to get a real Atom XML example? You can follow this tutorial to get a real Atom XML example: 1...
How to create a new API on the Publisher Dashboard of an Azure API Management Service? If you are ne...
What is EPUB 3.0 Metadata "dcterms:modified" property? EPUB 3.0 Metadata "dcterms:modified" is a req...
How to use .NET CLR Types in Azure API Policy? By default, Azure imports many basic .NET CLR (Common...
How to use the RSS Online Validator at w3.org? You can follow this tutorial to learn how to use the ...