We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,459 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Replace Spaces With + icon

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
1 Hour
Discussion Span
8 Months Ago
Last Updated
3
Views
Question
Answered
rakibtg
Junior Poster in Training
74 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hello,
Try this script:

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

jajarvin
Newbie Poster
6 posts since Jan 2010
Reputation Points: 10
Solved Threads: 2
Skill Endorsements: 0

thanks , it works :)

rakibtg
Junior Poster in Training
74 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 8 Months Ago by jajarvin

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0633 seconds using 2.65MB