[PHP] Re: Replace a space with a newline every 2 spaces

2010-04-22 Thread Lupus Michaelis
Le 22/04/2010 19:29, Paul Halliday a écrit : I found some long functions to achieve this but I couldn't help but think that it could be done in a couple lines. Possible? http://us.php.net/manual/en/function.wordwrap.php -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General

Re: [PHP] Re: replace special characters

2005-02-24 Thread Frank Arensmeier
Thank you Stian! In Swedish they say "Sometimes you can't see the forest by all the trees." /frank 2005-02-24 kl. 09.45 skrev Stian Berger: On Thu, 24 Feb 2005 09:14:32 +0100, Frank Arensmeier <[EMAIL PROTECTED]> wrote: Hello everybody! I was wondering if you could help me with a little problem

[PHP] Re: replace special characters

2005-02-24 Thread Stian Berger
On Thu, 24 Feb 2005 09:14:32 +0100, Frank Arensmeier <[EMAIL PROTECTED]> wrote: Hello everybody! I was wondering if you could help me with a little problem I ran into some days ago. In my database I have some information about file paths. Originally, those paths come from a Windows Excel sp

Re: [PHP] Re: replace value of array by key of array in string variable with pre

2004-08-21 Thread Justin Patrin
On Sat, 21 Aug 2004 12:54:15 -0500, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > Turbo wrote: > > Hi, > > > > I have array variable and string variable. > > I want to replace value of array by key of array in string variable > > with preg_replace(). > > > > Example : > > $message=array( > > 'name'=

[PHP] Re: replace value of array by key of array in string variable with pre

2004-08-21 Thread Shawn McKenzie
Turbo wrote: Hi, I have array variable and string variable. I want to replace value of array by key of array in string variable with preg_replace(). Example : $message=array( 'name'=>'My Computer', 'version'=>'1.0' ); $strValue="I am $name,build version $version\n"; How's to replace? Yingyos Why

Re: [PHP] Re: Replace a button by an image

2004-07-30 Thread Curt Zirzow
* Thus wrote Justin Patrin: > On Fri, 30 Jul 2004 23:14:53 +0100, Harlequin > <[EMAIL PROTECTED]> wrote: > > Henri. > > > > I prefer to use CSS for things like this but I'm sure PHP has it's own > > idiosyncrasies. > > > > I checked out the site posted in response to your post and personally > >

Re: [PHP] Re: Replace a button by an image

2004-07-30 Thread Justin Patrin
On Fri, 30 Jul 2004 23:14:53 +0100, Harlequin <[EMAIL PROTECTED]> wrote: > Henri. > > I prefer to use CSS for things like this but I'm sure PHP has it's own > idiosyncrasies. > > I checked out the site posted in response to your post and personally > thought the graphics were a bit ropey. > > ty

[PHP] Re: Replace a button by an image

2004-07-30 Thread Harlequin
Henri. I prefer to use CSS for things like this but I'm sure PHP has it's own idiosyncrasies. I checked out the site posted in response to your post and personally thought the graphics were a bit ropey. typically CSS is used for replacing images or backgrounds on hover but is very flexible and q

[PHP] Re: replace n first occurences of a char in a string

2004-07-23 Thread Jason Barnett
Then, once I have determined there are more than one dot, how can I remove all the dots but the right most one? You can replace a limited number of matches using preg_replace(). $number = '123.456.789.10'; $count = substr_count($number, '.'); $number = preg_replace('/\./', '', $number, $count -

[PHP] Re: Replace space from form field using preg_replace

2004-03-17 Thread Ben Ramsey
If you're doing this to pass it through a URL, then use urlencode() http://www.php.net/urlencode Vernon wrote: I want to be able to replace a space that comes from a form field (such as in 123 My Street) with a + sign. Can anyone help me with this? Thanks -- Regards, Ben Ramsey http://benramsey

[PHP] Re: replace ' with "

2004-02-11 Thread Kim Steinhaug
Depending on the use you might also want to look at this one : htmlentities() If working with mySQL inserts consider this aswell : mysql_escape_string() And finally, javascripts in HTML doesnt like either the ' " or the equivilant htmlentities. I just wash them away direkt if i need to output som

[PHP] Re: replace %rand[x]-[y]% macro in string with random string

2003-12-02 Thread Luke
final note, for anyone who finds this interesting in the class, if you update the following 2 variables, this is the proper list $this->countrys = array("",".ac",".ad",".ae",".af",".ag",".ai",".al",".am",".an",".ao",".aq"," .ar",".as",".at",".au",".aw",".az",".ba",".bb",".bd",".be",".bf",".bg",".

Re: [PHP] Re: replace %rand[x]-[y]% macro in string with random string

2003-12-02 Thread daniel hahler
on Wed, 3 Dec 2003 10:54:10 +1100 Luke wrote: L> result on my laptop for default script settings L> (P4 2.66, 512mb ram) L> 20 L> loaded in: 1.3158s thanks for the test.. L> please tell me what you think of this? if you like it i can email it to you L> (as a php file) Looks good, I have alr

[PHP] Re: replace %rand[x]-[y]% macro in string with random string

2003-12-02 Thread Luke
i forgot to mention, that being a class, you should be able to set any of the variable you want (either on class creation: new honeyPot($value1, $value2, etc); or with the class variables, $spambot = new honeyPot; $spambot->addresses = 50; //amount to create) Luke -- PHP General Mailing List (ht

[PHP] Re: replace %rand[x]-[y]% macro in string with random string

2003-12-02 Thread Luke
result on my laptop for default script settings (P4 2.66, 512mb ram) 20 loaded in: 1.3158s please tell me what you think of this? if you like it i can email it to you (as a php file) --begin php code--- umin = $usermin; $this->umax = $usermax; $this->addresses = $add

[PHP] Re: replace string in array

2003-03-16 Thread Jan Grafström
Chris, you can splice an array http://www.php.net/manual/sv/function.array-splice.php Jan Grafstrom "Chris Winters" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > I'm having a bit of trouble... > > I have an array that consists of a string like this: > > string1\rstring2\rst

[PHP] Re: Replace

2002-08-16 Thread Bogdan Stancescu
Have you tried searching string functions on http://www.php.net ? Bogdan Alexander Lindstedt wrote: > If i want to find just a word in a variable, and then replace just that > specific word... is there any simple way to do this? > > -- PHP General Mailing List (http://www.php.net/) To unsub

[PHP] Re: replace digits

2002-03-19 Thread liljim
Hi Marc, try this: $string = preg_replace("/^41/", "0", $string); http://www.php.net/preg_replace / and / = delimiters ^ = start of string (line in multiline mode) So, it translates as, "replace a leading 41 in $string with 0". ..or try the ereg function, which has already been mentioned. J

[PHP] Re: Replace ANYTHING between

2001-07-23 Thread James Holloway
Hi Dan, maybe something like: $newvariablethatwewantbetweenthetags = "Long variable!"; $string = preg_replace("/()(.*?)(<\/TAG>)/i", \\1$newvariablethatwewantbetweenthetags\\2, $string)); There should be a " after and before the second part of that statement, but my email proggy strips them.