Current location: Hot Scripts Forums » Programming Languages » PHP » how can i change or replace from one character to other character


how can i change or replace from one character to other character

Reply
  #1 (permalink)  
Old 09-25-06, 04:06 AM
mailme420's Avatar
mailme420 mailme420 is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
how can i change or replace from one character to other character

hi, i am new on PHP
help me if you can.

how can i change or replace from one character to other character?

i need to replace on space to "+".

example: this is a example.

after change : this+is+a+example.
Reply With Quote
  #2 (permalink)  
Old 09-25-06, 04:09 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
With str_replace()
PHP Code:



$string 
'this is a example.';

echo 
str_replace(' ''+'$string); 
Reply With Quote
  #3 (permalink)  
Old 09-25-06, 04:16 AM
mailme420's Avatar
mailme420 mailme420 is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
thank you very much.
Reply With Quote
  #4 (permalink)  
Old 09-25-06, 04:32 AM
nova912's Avatar
nova912 nova912 is offline
Code Guru
 
Join Date: Sep 2004
Location: Traverse City, MI, USA
Posts: 821
Thanks: 0
Thanked 0 Times in 0 Posts
if you looking to make chars like space or < or > or &, URL friendly use urlencode($var); and urldecode($var); on the other end =)
Reply With Quote
  #5 (permalink)  
Old 09-26-06, 02:52 AM
mailme420's Avatar
mailme420 mailme420 is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by nova912
if you looking to make chars like space or < or > or &, URL friendly use urlencode($var); and urldecode($var); on the other end =)
i don't understand what you say. please say more details.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wanted to replace special characters in MS Access using VB, but more than 1 character cebuy Visual Basic 3 12-04-05 05:30 PM
Replace any character ronlar PHP 2 09-22-05 12:46 PM
How to replace extended Character with character luv_suresh Perl 1 06-22-05 12:16 AM
form mailer replace character lordy PHP 2 06-15-05 10:50 PM
replace pattern-problm with pointers Erev0s C/C++ 0 05-25-04 02:30 AM


All times are GMT -5. The time now is 05:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.