Re: [PHP] String replace inside

2005-01-07 Thread Jason Wong
On Friday 07 January 2005 07:32, Fredrik Arild Takle wrote: > I have a some problems doing a search and replace in a string. > I want to replace: > > with > > > Note ALT, src, border properties may come in random order. > > My solution today is a not good enough because I only do an eregi_replace

[PHP] String replace inside

2005-01-07 Thread Fredrik Arild Takle
I have a some problems doing a search and replace in a string. I want to replace: with Note ALT, src, border properties may come in random order. My solution today is a not good enough because I only do an eregi_replace on all image.php, I only want to replace those inside a Todays solution

Re: [PHP] string replace in files

2004-04-30 Thread John W. Holmes
From: "Steve Buehler" <[EMAIL PROTECTED]> > Thank you so much for this. I was thinking of it all wrong when > doing this. I have a couple of other questions to go along with this. > 1. How would I change this to do a recursive search for the .php files > instead of just the *.php or *

Re: [PHP] string replace in files

2004-04-30 Thread Steve Buehler
At 11:27 AM 4/30/2004, John W. Holmes wrote: From: "Steve Buehler" <[EMAIL PROTECTED]> > #!/usr/bin/php > $strtoreplace="require \"http://www.domain.com/";; > $replacewithstring="require \"/home/domain/www/"; > > replacestring(); > > function replacestring(){ > GLOBAL $strtoreplace,$replacewithst

Re: [PHP] string replace in files

2004-04-30 Thread John W. Holmes
From: "Steve Buehler" <[EMAIL PROTECTED]> > I am trying to write a script that will replace a string in a > file. Actually, about 3000 files. And I am stuck. I can get the list of > files, but then I pretty much become stuck. I wanted to try str_ireplace > (not sure if that is what I should us

[PHP] string replace in files

2004-04-30 Thread Steve Buehler
I am trying to write a script that will replace a string in a file. Actually, about 3000 files. And I am stuck. I can get the list of files, but then I pretty much become stuck. I wanted to try str_ireplace (not sure if that is what I should use or not), but I can't even get far enough to d

Re: [PHP] String replace in php

2004-04-22 Thread Jason Wong
On Friday 23 April 2004 12:30, T UmaShankari wrote: > I need to replace a character " with "\. Using php how to do this. i > have given like this but it is giving parse error > > $temps=str_replace('"','"\',$temp); > > Can anyone tell me how to do this ? Try: $temps = str_replace('"','"\

[PHP] String replace in php

2004-04-22 Thread T UmaShankari
Hellow, I need to replace a character " with "\. Using php how to do this. i have given like this but it is giving parse error $temps=str_replace('"','"\',$temp); Can anyone tell me how to do this ? Regards, Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

[PHP] String replace in php

2004-04-22 Thread T UmaShankari
Hellow, I need to replace a character " with "\. Using php how to do this. i have given like this but it is giving parse error $temps=str_replace('"','"\',$temp); Can anyone tell me how to do this ? Regards, Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

RE: [PHP] string replace problem!!

2003-03-28 Thread Thijs Lensselink
ch Gray [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 28 maart 2003 12:39 Aan: Thijs Lensselink; [EMAIL PROTECTED] Onderwerp: RE: [PHP] string replace problem!! > Good day , > > I have the following string. > ,slideimages[0],slideimages[1],slideimages[2] > Wich starts with a ',

RE: [PHP] string replace problem!!

2003-03-28 Thread Rich Gray
> Good day , > > I have the following string. > ,slideimages[0],slideimages[1],slideimages[2] > Wich starts with a ','. No my problem is i want to strip > this first and only the first ','. > > i've tried > $string = ",slideimages[0],slideimages[1],slideimages[2]"; > $string = preg_replace('/^./

[PHP] string replace problem!!

2003-03-28 Thread Thijs Lensselink
Good day , I have the following string. ,slideimages[0],slideimages[1],slideimages[2] Wich starts with a ','. No my problem is i want to strip this first and only the first ','. i've tried $string = ",slideimages[0],slideimages[1],slideimages[2]"; $string = preg_replace('/^./','',$string,1); wi

Re: [PHP] String Replace

2003-03-14 Thread Leif K-Brooks
www.php.net/str-replace Awlad Hussain wrote: I have a string with underscore in the middle.. like "This_That" which function do i use to replace the _ with space? eg to "This That" the string is in a variable.. I know its really simple but just don't know which function to use. any suggestion?

RE: [PHP] String Replace

2003-03-14 Thread Niklas Lampén
[mailto:[EMAIL PROTECTED] Sent: 14. maaliskuuta 2003 13:26 To: [EMAIL PROTECTED] Subject: [PHP] String Replace I have a string with underscore in the middle.. like "This_That" which function do i use to replace the _ with space? eg to "This That" the string is in a variable.. I kn

[PHP] String Replace

2003-03-14 Thread Awlad Hussain
I have a string with underscore in the middle.. like "This_That" which function do i use to replace the _ with space? eg to "This That" the string is in a variable.. I know its really simple but just don't know which function to use. any suggestion? -awlad

RE: [PHP] string replace using ereg

2001-07-16 Thread scott [gts]
#x27;=> 'BOB', ); $OPENTAG = "<<"; $CLOSETAG = ">>"; print preg_replace( "/$OPENTAG(.*?)$CLOSETAG/e", '$ASSIGN[$1]', $text ); > -Original Message- > From: Jeroen Olthof [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 16, 2001

RE: [PHP] string replace using ereg

2001-07-16 Thread scott [gts]
'$ASSIGN[$1]', $text ); prints: Hello there, this is a test. My name is BOB To do what you want, throw a loop statement around the preg_replace to loop thru each line of a file... etc... :) > -Original Message- > From: Jeroen Olthof [mailto:[EMAIL PROTECTED]] > Sent: Mo

[PHP] string replace using ereg

2001-07-16 Thread Jeroen Olthof
hi, I want to replace strings in string using a key / value array as the replacemant contract basicly, I want to find a open en close tag, pick out the word in the middle and replace it by the value of the key that match the picked out word. example <> <> should result in this is a test this i

Re: [PHP] string replace

2001-01-17 Thread Monte Ohrt
If you're looking to strip off just the file extension, you can use pathinfo() to get that. I don't think it is a documented function, so use var_dump(pathinfo($var)) to see what it outputs. Tait Grove wrote: > > How can I strip everything past a certain character in a string? > > i.e.: > > $f

RE: [PHP] string replace

2001-01-16 Thread Maxim Maletsky
but you would have to count how many dots are there ... -Original Message- From: Gregor [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 17, 2001 5:20 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] string replace $foo = "test.gif"; $foo1 = substr($foo, 0, strpos($foo, &q

Re: [PHP] string replace

2001-01-16 Thread Gregor
$foo = "test.gif"; $foo1 = substr($foo, 0, strpos($foo, ".")); this should work :) gregor ""Tait Grove"" <[EMAIL PROTECTED]> wrote in message 002a01c07ff7$0dffee20$[EMAIL PROTECTED]">news:002a01c07ff7$0dffee20$[EMAIL PROTECTED]... How can I strip everything past a certain character in a string

RE: [PHP] string replace

2001-01-16 Thread Jerry Lake
Here is a bad way to do it, but it works Jerry Lake -Original Message- From: Tait Grove [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 12:01 PM To: PHP GENERAL Subject: [PHP] string replace How can I strip everything past a certain character in a string? i.e.: $foo

Re: [PHP] string replace

2001-01-16 Thread Nathan Cook
you follow an 8.3 or 8.4 character filename structure you will be fine. .:: Nathan Cook - Original Message - From: "Tait Grove" <[EMAIL PROTECTED]> To: "PHP GENERAL" <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:01 PM Subject: [PHP] string replace Ho

[PHP] string replace

2001-01-16 Thread Tait Grove
How can I strip everything past a certain character in a string? i.e.: $foo = "test.gif"; // strip past the .gif $foo = "test"; // again $foo2 = "test.jpeg"; // strip past the .jpeg $foo2 = "test"; Tait