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, 1365👍, 0💬
Popular Posts:
How to write a policy to set and get custom variables? Here is a policy that sets and gets custom va...
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...
How To Pass Arrays By References? in PHP? Like normal variables, you can pass an array by reference ...
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...
How to login to Azure API Management Publisher Dashboard? If you have given access permission to an ...