473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ereg_replace quastion

hi, all, need your help guys!
i have a variable $var = "one two";
i need to replace space betwin one and two with "+".
any idea? thank you all

Oct 27 '05 #1
2 1269
Jit
Use str_replace function.

Oct 27 '05 #2
ki*******@hotmail.com schreef op 27-10-2005 16:41:
hi, all, need your help guys!
i have a variable $var = "one two";
i need to replace space betwin one and two with "+".
any idea? thank you all


If you want to encode something to pass in an URL, try urlencode(). This
function also replaces spaces with an +.

--
Met vriendelijke groeten,
Geert Wirken
Oct 27 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Roland Sippel | last post by:
Is there anything change in "ereg_replace()" PHP > 4.3.2. Scripts works in PHP 4.3.1 but NOT in PHP 4.3.2: $text = "<!-- test -->"; $text = ereg_replace("]+"," ",strip_tags($text)); echo $text...
2
by: Chris | last post by:
Hello, I use a javascript ticker in my header which contains the news in a array like that tickercontents='Message1' tickercontents='Message2' tickercontents='Message3' now i want to write an...
4
by: knocte | last post by:
Hello. I am testing this curious code and I don't understand yet why it doesn't work with the 2nd case: Case 1: $number = "2,4"; $number = ereg_replace(",",".",$number); echo $number; //...
0
by: Sean Pinto | last post by:
i am designing a search engine for our website. i want to allow for searchablity based on partial string match as well as quoted exact matches. for example the search search text many would...
3
by: Xaradas | last post by:
Someone could tell me why preg_replace eat a slash when it do replacement? <? $stringToReplace = "blah blah {nome} blah blah"; $replacement = "Two slash: \\\\"; $stringToReplace =...
0
by: pieterprovoost | last post by:
Hi, I would like to use the ereg_replace() function to replace wiki-like syntax, for example: ] becomes <a href="index.php?page=somepage">somepage</a> **hello** becomes <i>hello</i>
1
by: tmcp | last post by:
Hello I'm a bit new to regular expressions and I'm having a problem I'm trying to strip any code which is inside a <p> tag for instance from <p style="margin: 0in 0in 0pt;" class="MsoNormal"> to...
2
by: encepif | last post by:
I think this is the right command., could someone please show me how to replace instances of a quote like this " with its html version - &quot;. I am mixed up with the escaping, etc. Thank you :-) ...
6
by: chromis | last post by:
Hi, I'm trying to remove line breaks from a user-inputted string and trying to do this using ereg_replace and a regular expression but struggling, hope someone can help! I would like to make...
5
by: Hugh Oxford | last post by:
I have a string that has been saved in a database from a textarea form field. e.g. $text = "Dear %name The date is %date yours,
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.