0

hello everyone, what is the way to replace Spaces With + icon using PHP. Suppose some text like "I Love PHP" will automatically converted like this way "I+Love+PHP" .. assuming a field has this text in a variable like> $text = I Love PHP so this variables text spaces will be replace with a + sign in a new variable like this> $text_plus=I+Love+PHP how to do it with PHP?
Thanks

2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by rakibtg
1

Hello,
Try this script:

<?php
$text = "I Love PHP";
$text_plus = str_replace(" ", "+", $text);
echo $text_plus;
?>

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.