[PHP] Replace in a string with regex

2009-07-22 Thread rszeus
Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular expression. $file = screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg; echo $a = str_replace(array(7a45gfdi6icpan1jtb1j99o925, 'temp/',’_([0-9])’), array(“test”,,””), $file) The idea is to

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Eddie Drapkin
On Wed, Jul 22, 2009 at 8:02 AM, rszeusrsz...@gmail.com wrote: Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular expression. $file = screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg; echo $a =  str_replace(array(7a45gfdi6icpan1jtb1j99o925,

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Ashley Sheridan
On Wed, 2009-07-22 at 13:02 +0100, rszeus wrote: Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular expression. $file = screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg; echo $a = str_replace(array(7a45gfdi6icpan1jtb1j99o925,

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
] Replace in a string with regex On Wed, Jul 22, 2009 at 8:02 AM, rszeusrsz...@gmail.com wrote: Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular expression. $file = screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg; echo $a = str_replace(array

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Eddie Drapkin
Para: rszeus Cc: php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 8:02 AM, rszeusrsz...@gmail.com wrote: Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular expression. $file = screens/temp

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
:20 Para: rszeus Cc: php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, 2009-07-22 at 13:02 +0100, rszeus wrote: Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular expression. $file = screens/temp

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Robert Cummings
rszeus wrote: Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular expression. $file = screens/temp/7a45gfdi6icpan1jtb1j99o925_1_main.jpg; echo $a = str_replace(array(7a45gfdi6icpan1jtb1j99o925, 'temp/',’_([0-9])’), array(“test”,,””), $file)

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Robert Cummings
You can disregard this, it's wrong (I missed a part of the requirements :) and there's other solutions already provided (my email client is weird when you switch to a folder it always displays the first entry as the last read, so sometimes I miss that there are new posts above... I just

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
Drapkin [mailto:oorza...@gmail.com] Enviada: quarta-feira, 22 de Julho de 2009 14:12 Para: rszeus Cc: php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 9:07 AM, rszeusrsz...@gmail.com wrote: Hi. It Works to remove the _1 but it doesn't replace

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Jim Lucas
you -Mensagem original- De: Eddie Drapkin [mailto:oorza...@gmail.com] Enviada: quarta-feira, 22 de Julho de 2009 14:12 Para: rszeus Cc: php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 9:07 AM, rszeusrsz...@gmail.com wrote

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Ashley Sheridan
, 22 de Julho de 2009 13:11 Para: rszeus Cc: php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 8:02 AM, rszeusrsz...@gmail.com wrote: Hello, I’m tryng to make some replacements on a string. Everything goês fine until the regular

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Eddie Drapkin
: rszeus Cc: php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 9:07 AM, rszeusrsz...@gmail.com wrote: Hi. It Works to remove the _1 but it doesn't replace '7a45gfdi6icpan1jtb1j99o925' for 'test' Thank you -Mensagem original

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Andrew Ballard
On Wed, Jul 22, 2009 at 11:01 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-07-22 at 07:54 -0700, Jim Lucas wrote: Sure that can be done.  But you will need to change the second argument to have double quotes so it will be parsed by PHP. Then I would surround YOUR variable

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
: Eddie Drapkin [mailto:oorza...@gmail.com] Enviada: quarta-feira, 22 de Julho de 2009 16:03 Para: a...@ashleysheridan.co.uk Cc: Jim Lucas; rszeus; php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex On Wed, Jul 22, 2009 at 11:01 AM, Ashley Sheridana...@ashleysheridan.co.uk

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Jim Lucas
De: Kyle Smith [mailto:kyle.sm...@inforonics.com] Enviada: quarta-feira, 22 de Julho de 2009 17:22 Para: rszeus Cc: 'Eddie Drapkin'; a...@ashleysheridan.co.uk; 'Jim Lucas'; php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex The first match inside

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
2009 18:44 Para: rszeus Cc: 'Kyle Smith'; 'Eddie Drapkin'; a...@ashleysheridan.co.uk; php-general@lists.php.net Assunto: Re: [PHP] Replace in a string with regex rszeus wrote: Thank you. I undestand now. Anh it’s already workyng the replacemente with letteres. Bu if the variabele

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Jim Lucas
Assunto: Re: [PHP] Replace in a string with regex rszeus wrote: Thank you. I undestand now. Anh it’s already workyng the replacemente with letteres. Bu if the variabele is a number it doens’t work. Any ideas ? $file = screen/temp/7a45gfdi6icpan1jtb1j99o925_1_mini.jpg; $id = '70

RE: [PHP] Replace in a string with regex

2009-07-22 Thread Ford, Mike
-Original Message- From: rszeus [mailto:rsz...@gmail.com] Sent: 22 July 2009 19:23 To: 'Jim Lucas' Cc: 'Kyle Smith'; 'Eddie Drapkin'; a...@ashleysheridan.co.uk; php- gene...@lists.php.net Subject: RE: [PHP] Replace in a string with regex No, sory, my bad typing. It's

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
Thank you very much! Understand. And it Works very well now. Cheers -Mensagem original- De: Ford, Mike [mailto:m.f...@leedsmet.ac.uk] Enviada: quinta-feira, 23 de Julho de 2009 00:04 Para: php-general@lists.php.net Assunto: RE: [PHP] Replace in a string with regex -Original