How to String Replace Hash With Space in PHP?
Hi Dev,
In this example, you will learn how to string replace hash with space in PHP. This tutorial will give you simple example of all the space in a string with hash in PHP. I explained simply about replace hash (#) with space using PHP. step by step explain PHP string replace hash code example. follow bellow step for PHP str_replace function example.
str_replace() function is used to replace the hash with space.
Example: 1
index.php
<?php
$string = "Learn#PHP#post#at#nicesnippets.com";
$string = str_replace('#', ' ', $string);
echo $string;
?>
Output:
Learn PHP post at nicesnippets.com
I hope it could help you...
- How To Use Php Conditional Statement Example
- How to Check if String Contains Regex in PHP?
- PHP Array_column() Function Example
- PHP Generate List of Random Numbers Between 0 and 100 Example
- How to User Login with Facebook in PHP?
- How to Explode Every Character into Array Using PHP Example?
- PHP Form Validation Tutorial
- PHP Convert XML to JSON Example