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

2010-04-22 Thread Andrew Ballard
On Thu, Apr 22, 2010 at 1:29 PM, Paul Halliday wrote: > Ex: > > "This is the string and it is this long" > > This is > the string > and it > is this > long > > 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? > > Tha

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 > -Origi

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 strin

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Jim Lucas
Enviada: quarta-feira, 22 de Julho de 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.

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
l- De: Jim Lucas [mailto:li...@cmsws.com] Enviada: quarta-feira, 22 de Julho de 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 unde

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Jim Lucas
7;test'; > > echo preg_replace('#(screen/)temp/(.+?)_1(.+?\.jpg)#', '$1'.$id, $file); > > I get screen/test > > > > Any ideas ? > > > > Thank you > > > > De: Kyle Smith [mailto:kyle.sm...@inforonics.com] > Enviada: quart

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
uarta-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 () is assigned to $1, the second is assigned to $2, and so on

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Kyle Smith
ginal- 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, rszeus wrote: Hi. It Works to remove the _1 but it doesn

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
... -Mensagem original- De: 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, Ashle

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Andrew Ballard
On Wed, Jul 22, 2009 at 11:01 AM, Ashley Sheridan 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 with curly bracke

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Eddie Drapkin
quot;$1{$id}$3", >>                   $file); >> >> > I am confusing " and '. >> > >> > Thank you >> > >> > >> > -Mensagem original- >> > De: Eddie Drapkin [mailto:oorza...@gmail.co

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Ashley Sheridan
> > > -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 > >

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Jim Lucas
"$1{$id}$3", $file); > I am confusing " and '. > > Thank you > > > -Mensagem original- > De: Eddie Drapkin [mailto:oorza...@gmail.com] > Enviada: quarta-feira, 22 de Julho de 2009 14:12 > Para: rszeus &g

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
27;. Thank 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, rszeus wrote: >

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 switche

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 rszeus
leysheridan.co.uk] Enviada: quarta-feira, 22 de Julho de 2009 13: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. > > Ever

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Eddie Drapkin
a: quarta-feira, 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, rszeus wrote: >> Hello, >> >> I’m tryng to make some replacements on a string. >>

RE: [PHP] Replace in a string with regex

2009-07-22 Thread rszeus
Hi. It Works to remove the _1 but it doesn't replace '7a45gfdi6icpan1jtb1j99o925' for 'test' Thank you -Mensagem original- De: Eddie Drapkin [mailto:oorza...@gmail.com] Enviada: quarta-feira, 22 de Julho de 2009 13:11 Para: rszeus Cc: php-general@lists.

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(7a45gfdi6icpan1jtb1j99o

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Eddie Drapkin
On Wed, Jul 22, 2009 at 8:02 AM, 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, > 't

Re: [PHP] Replace/Update record in dbase using dbase_replace_record()

2007-07-02 Thread Jochem Maas
Rahul Sitaram Johari wrote: > Ave, > > Can¹t figure this one out. I¹m using the dbase_replace_record() function to > replace a record in a dbase (.dbf) database. I just want to replace the > value of one of the fields with another value. This is my code: > > $db = dbase_open("CRUMBS.DBF", 2) or d

Re: [PHP] replace single and double quotes

2006-08-30 Thread Jochem Maas
Rafael Mora wrote: > Hi! > > i want to send a file or output stream in a .php, but first compress it, I > tryed the example to compress files but how do i do to send as answer to > the > http request?? trye the other example > > Rafa > -- PHP General Mailing List (http://www.php.net/) To un

Re: [PHP] replace single and double quotes

2006-08-29 Thread Rafael Mora
Hi! i want to send a file or output stream in a .php, but first compress it, I tryed the example to compress files but how do i do to send as answer to the http request?? Rafa

RE: [PHP] replace single and double quotes

2006-08-29 Thread tedd
At 5:04 PM +0200 8/29/06, Reinhart Viane wrote: About the language remark: I believe you try to say I need to find a way that the client can add 25 languages without me having to change the database layout or the coding? Well I can assure you this will not be the fact. The client only needs these

RE: [PHP] replace single and double quotes

2006-08-29 Thread Peter Lauri
8:37 PM To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] replace single and double quotes Reinhart Viane wrote: > This is the code is use to insert/update text into a database field: > > $sqledit="update activities set act_extra='$_POST[editextra]',

Re: [PHP] replace single and double quotes

2006-08-29 Thread Jochem Maas
: dinsdag 29 augustus 2006 15:37 > Aan: [EMAIL PROTECTED] > CC: php-general@lists.php.net > Onderwerp: Re: [PHP] replace single and double quotes > > Reinhart Viane wrote: >> This is the code is use to insert/update text into a database field: >> >> $sqledit=&quo

RE: [PHP] replace single and double quotes

2006-08-29 Thread Reinhart Viane
Ok 'ill give this a shot together with the guidelines from jochen. Thx afan. -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 29 augustus 2006 15:28 Aan: [EMAIL PROTECTED] CC: php-general@lists.php.net Onderwerp: Re: [PHP] replace singl

RE: [PHP] replace single and double quotes

2006-08-29 Thread Reinhart Viane
, didn't think this question was about to bring up what I was looking for in the back of my head -Oorspronkelijk bericht- Van: Jochem Maas [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 29 augustus 2006 15:37 Aan: [EMAIL PROTECTED] CC: php-general@lists.php.net Onderwerp: Re: [PHP] replace s

RE: [PHP] replace single and double quotes

2006-08-29 Thread Peter Lauri
ot;, $act_extra, $act_extra_fr, $act_id); Notice the %d for the id part if $act_id should be integer. /Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2006 8:28 PM To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] re

Re: [PHP] replace single and double quotes

2006-08-29 Thread Jochem Maas
Reinhart Viane wrote: > This is the code is use to insert/update text into a database field: > > $sqledit="update activities set act_extra='$_POST[editextra]', > act_extra_fr='$_POST[editextrafr]' where act_id=$_POST[editid]"; this indicates 'bad' database design ... because adding a language inv

Re: [PHP] replace single and double quotes

2006-08-29 Thread Jochem Maas
[EMAIL PROTECTED] wrote: > since I had something similar as a problem, let m etry to anser ang see > did I get it correct :) seems ok ... > > first, and most important: never store in DB row submitted string > > $act_extra = mysql_real_escape_string($_POST[editextra]); > $act_extra_fr = mysql_r

Re: [PHP] replace single and double quotes

2006-08-29 Thread afan
since I had something similar as a problem, let m etry to anser ang see did I get it correct :) first, and most important: never store in DB row submitted string $act_extra = mysql_real_escape_string($_POST[editextra]); $act_extra_fr = mysql_real_escape_string($_POST[editextrafr]) $act_id = mysql

Re: [PHP] replace

2005-09-19 Thread tg-php
I hope this is what you were looking for: $contents = "Numbers 1, 2, 3, 4 and 5 will be replaced with A, B, C, D, and E"; $searcharr = array("1", "2", "3", "4", "5"); $replacearr = array("A", "B", "C", "D", "E"); $newcontents = str_replace($searcharr, $replacearr, $contents); echo $newcontents;

Re: [PHP] replace striing éèêà

2005-06-06 Thread Jochem Maas
John Taylor-Johnston wrote: Can someone show me how to get rid of international characters in $string? Is there a function already made? the acute/grave accents on the chars are called 'diacritics' You cannot use accented characters in a name reference : name="montréal">. I guess this below i

Re: [PHP] replace striing éèêà

2005-06-05 Thread Chris
Look into strtr() http://www.php.net/strtr It seems to be precisely what you want. John Taylor-Johnston wrote: Can someone show me how to get rid of international characters in $string? Is there a function already made? You cannot use accented characters in a name reference : name="montréal">

Re: [PHP] replace special characters

2005-02-24 Thread Jason Wong
On Thursday 24 February 2005 16:14, Frank Arensmeier wrote: > 1) replace ".." with a string like "file://server/folder" > 2) replace all "\" characters with "/". > > The PHP code looks something like: > > $path_to_file = "..\1 PDF Filer\65051.PDF"; $path_to_file = '..\1 PDF Filer\65051.PDF'; D

Re: [PHP] replace

2005-01-28 Thread Jochem Maas
blackwater dev wrote: thanks...I will look that up. Not very good with regular expressions though. this is your chance to get a bit better. have a go, if you get stuck post your code :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] replace

2005-01-28 Thread blackwater dev
thanks...I will look that up. Not very good with regular expressions though. On Fri, 28 Jan 2005 08:11:59 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]> wrote: > blackwater dev wrote: > > I have a section of my site that uses HTMLArea to allow the users to > > manage content. For one certain s

Re: [PHP] replace

2005-01-28 Thread Richard Lynch
blackwater dev wrote: > I have a section of my site that uses HTMLArea to allow the users to > manage content. For one certain section, they want all of their links > to pop up in another window. I know they can use HTMLArea and add > this code themselves but they don't want to get to the code si

Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Jordi Canals
On Tue, 25 Jan 2005 16:29:38 -, Chris Ramsay <[EMAIL PROTECTED]> wrote: > > > >Hey! > >I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!? > > > > I have received this also with both my postings today...and probably will > again... > I've just sent ONE message to the list

Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread John Nichel
Mike Johnson wrote: From: Richard Davey [mailto:[EMAIL PROTECTED] Hello Afan, Tuesday, January 25, 2005, 4:12:43 PM, you wrote: AP> Hey! AP> I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!? Join the club.. everyone who posts gets one. Annoying, no? Best regards, Richard Davey

RE: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Chris Ramsay
>Hey! >I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!? I have received this also with both my postings today...and probably will again... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Richard Davey
Hello Chris, Tuesday, January 25, 2005, 5:07:37 PM, you wrote: CR> Maybe that's another thing to add to the [NEWBIE GUIDE] - I would have found CR> it useful! ;) Ahh... so you're the Russian mail server? :) I guess we could add "don't be a twat with your auto-responders" to the newbie faq, but

[PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Chris Ramsay
Join the club.. everyone who posts gets one. Annoying, no? Maybe that's another thing to add to the [NEWBIE GUIDE] - I would have found it useful! ;) Chris Ramsay - Web Developer - The Danwood Group Ltd. T: +44 (0) 1522 834482 F: +

Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread Afan Pasalic
Not at all... Actually, I enjoy :-D I just wonder what's going on and is it problem on my side or... Now I breath easier... ;-) -afan Richard Davey wrote: Hello Afan, Tuesday, January 25, 2005, 4:12:43 PM, you wrote: AP> Hey! AP> I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!

RE: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread Mike Johnson
From: Richard Davey [mailto:[EMAIL PROTECTED] > Hello Afan, > > Tuesday, January 25, 2005, 4:12:43 PM, you wrote: > > AP> Hey! > AP> I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!? > > Join the club.. everyone who posts gets one. Annoying, no? > > Best regards, > > Richard

RE: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numberswith X ???)]

2005-01-25 Thread Jay Blanchard
[snip] I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!? What's going on? [/snip] I have been getting it with every send too...off to /dev/null -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread Richard Davey
Hello Afan, Tuesday, January 25, 2005, 4:12:43 PM, you wrote: AP> Hey! AP> I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!? Join the club.. everyone who posts gets one. Annoying, no? Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services "I a

Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread Jochem Maas
Jay Blanchard wrote: [snip] I need to replace all the numbers of a credit card except for the last 4 with an 'X' ... can't seem to locate the string function for this... can someone point me in the right direction here to what php item i should be using. [/snip] ROFLMMFAO! It's all been discussed b

Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread tg-php
In addition to what was mentioned already, using ereg_replace, if you're pulling the CC# string out of a database of off of some POST data or something, just use a substr() function to pull the last 4 digits and prepend a bunch of X's. $ccnum = "342342522342342"; # fake CC #, prob not even cor

Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread Jochem Maas
Joe Harman wrote: Hello, I need to replace all the numbers of a credit card except for the last 4 with an 'X' ... can't seem to locate the string function for this... can someone point me in the right direction here to what php item i should be using. that'll be: string php_replace_all_but_last_fou

[PHP] [Fwd: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)]

2005-01-25 Thread Afan Pasalic
Hey! I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!? What's going on? -afan Original Message Subject: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???) Date: Tue, 25 Jan 2005 19:13:27 +0300 From: RIPN NCC <[EMAIL PROTEC

Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread Afan Pasalic
this is my way. $cc_stars = ''; $cc_no_lenght = strlen($cc_number); $cc_info_first4 = substr($cc_number, 0, 4); $cc_info_last4 = substr($cc_number, (strlen($cc_number) - 4), 4); for($i=0; $i<($cc_no_lenght-8); $i++) $cc_stars .= '*'; $cc_number = $cc_info_f

RE: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread Jay Blanchard
[snip] I need to replace all the numbers of a credit card except for the last 4 with an 'X' ... can't seem to locate the string function for this... can someone point me in the right direction here to what php item i should be using. [/snip] ROFLMMFAO! It's all been discussed before Joe! http://

RE: [PHP] Replace or regex?

2004-09-30 Thread Dan Joseph
Hi, > > I have a string: ##CODE## and I want to replace that with > href="somewhere.php?id=CODE">CODE I handle %code% tags in some templates I use... here's the code I have.. function show ($template, $tag) { $file = fopen ($template, "r") or die($error_

Re: [PHP] Replace or regex?

2004-09-30 Thread Brian
$var="##testcode##this is a ##code1## test of the ##code2## code replacement system ##code3##"; $varParsed=strParse($var); echo "$var"; echo $varParsed; function strParse($origString) { while ( $offsetFALSE) { $tmpString=substr($origString, $lastEnd, $foundBeg-$lastEnd); $tm

RE: [PHP] Replace or regex?

2004-09-30 Thread Graham Cossey
id.'">', $orig_text); $new_text = str_replace( '#/', '', $new_text); see: http://www.php.net/manual/en/ref.strings.php HTH Graham -Original Message- From: Gareth Williams [mailto:[EMAIL PROTECTED] Sent: 30 September 2004 09:38 To: mario Cc: [EMAIL PROTECTED] S

Re: [PHP] Replace or regex?

2004-09-30 Thread Gareth Williams
Well, if you can do it without a regex, then it's always best, because the regex engine slows things down. On 30 Sep 2004, at 10:39, mario wrote: Hi all I have a string: ##CODE## and I want to replace that with CODE can u help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vis

Re: [PHP] replace accents

2004-09-14 Thread -{ Rene Brehmer }-
At 17:51 14-09-2004, Diana Castillo wrote: Anyone know of any function to replace letters with accents with just the regular letter, for instance replace á with a, ç with c, ñ with n ? How about this ??? This is the one I made for this purpose function stripAccents($string) { $returnString = strt

Re: [PHP] replace accents

2004-09-14 Thread Rick Fletcher
Diana Castillo wrote: Anyone know of any function to replace letters with accents with just the regular letter, for instance replace á with a, ç with c, ñ with n ? found this on the strtr() manual page (http://php.net/strtr): 'TH', 'þ' => 'th', 'Ð' => 'DH', 'ð' => 'dh', 'ß' => 'ss', 'Œ'

Re: [PHP] replace accents

2004-09-14 Thread Marek Kilimajer
Diana Castillo wrote: Anyone know of any function to replace letters with accents with just the regular letter, for instance replace á with a, ç with c, ñ with n ? $string = str_replace(array('á', 'ç', 'ñ'), array('a', 'c', 'n'), $string); -- PHP General Mailing List (http://www.php.net/) To uns

Re: [PHP] replace accents

2004-09-14 Thread Greg Donald
On Tue, 14 Sep 2004 17:51:00 +0200, Diana Castillo <[EMAIL PROTECTED]> wrote: > Anyone know of any function to replace letters with accents with just the > regular letter, for instance replace á with a, > ç with c, ñ with n ? str_replace(), eregi_replace() -- Greg Donald http://destiney.com/ -

Re: [PHP] Replace a button by an image

2004-07-30 Thread PHP Gen
> Jay Blanchard wrote: > > Yes, anything is possible. > > Can I be the next Queen of England? > > -- > John C. Nichel Anythings possible...and with all your choices you want to be an old fart?? :-) = -- - The faulty interface lies between the chair and the keyboard. - Creativity

Re: [PHP] Replace a button by an image

2004-07-30 Thread John Nichel
Jay Blanchard wrote: Yes, anything is possible. Can I be the next Queen of England? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Replace a button by an image

2004-07-30 Thread Jay Blanchard
[snip] Is it possible to replace a button by an image with PHP? [/snip] Yes, anything is possible. http://phpbutton.sourceforge.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

2004-07-26 Thread Jason Wong
On Monday 26 July 2004 10:09, Turbo wrote: > 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 versi

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

2004-03-17 Thread Red Wingate
str_replace(" ","+",$var); -- red 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

2004-03-17 Thread Adam Voigt
http://www.php.net/str-replace On Wed, 2004-03-17 at 15:48, 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 -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (

[PHP] RE: [PHP-WIN] Re: [PHP] Replace of ' in a query

2004-02-17 Thread Svensson, B.A.T. (HKG)
so, and still works fine. Why not stay with a winner? -Original Message- From: Brent Baisley To: carlos castillo Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: 2004-02-17 21:02 Subject: [PHP-WIN] Re: [PHP] Replace of ' in a query Look at the addslashes command. You should always e

Re: [PHP] Replace of ' in a query

2004-02-17 Thread Brent Baisley
Look at the addslashes command. You should always escape the values you are accepting from user input. If you read almost any article on web site security, it will mention something called SQL injection among other things. This is a way to compromise your data. For instance, what if a user enter

Re: [PHP] Replace of ' in a query

2004-02-17 Thread Chris Shiflett
--- carlos castillo <[EMAIL PROTECTED]> wrote: > Hi , i have the following problem, i have a form where a user can input > any text, on that text may be a char is ' char(39) when i try to execute > the sql query, i have an error for that ', i need to replace it for the > html tag, for example " is

Re: [PHP] replace ' with "

2004-02-11 Thread John Nichel
Diana Castillo wrote: How do I replace all single quotes with double quotes in a string for echoing it with the double quotes? By looking here... http://us4.php.net/str_replace -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubs

RE: [PHP] replace ' with "

2004-02-11 Thread Angelo Zanetti
str_replace(''',"'", $StringToReplace); should work -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 4:33 PM To: [EMAIL PROTECTED] Subject: [PHP] replace ' with " How do I replace all single quotes with double quotes in a string for e

Re: [PHP] replace ' with "

2004-02-11 Thread Stuart
Diana Castillo wrote: How do I replace all single quotes with double quotes in a string for echoing it with the double quotes? $text = str_replace("'", '"', $text); http://php.net/str_replace and please at least RTFM before posting here in future. -- Stuart -- PHP General Mailing List (http://ww

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

2003-12-04 Thread daniel hahler
on Tue, 2 Dec 2003 23:46:33 +0100 I already wrote, regarding replacing macro %rand[x]-[y] with random of random length ([x]-[y]). Before, I had my own (slow!) procedure to find next occurence of the macro and generated a new string, which was returned. This took about 15 seconds for 10.000 addres

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

2003-12-02 Thread daniel hahler
on 02 Dec 2003 18:56:28 -0500 Robert Cummings wrote: RC> I missed the original post, and I'm too lazy to go looking, but the RC> following code runs in approx. 2.75 seconds on my Athlon 2400 running RC> linux: it is 4.3 seconds on xp 1600+.. RC> $chars = '0123456789' RC> .'abcdef

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

2003-12-02 Thread daniel hahler
on Tue, 2 Dec 2003 23:33:47 + Richard Davey wrote: RD> Just so we're clear on this - you're creating a string (an email RD> address) of a million characters? I don't know my mail RFC's that well, but RD> I'm sure this is well beyond what it considers "standard". We're not clear.. ;) the funct

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

2003-12-02 Thread Robert Cummings
On Tue, 2003-12-02 at 18:33, Richard Davey wrote: > Hello Daniel, > > Tuesday, December 2, 2003, 10:46:33 PM, you wrote: > > dh> For generation of a random string with length 1.000.000 it takes about > dh> 13 seconds on my xp 1600+.. that's quite a lot, imho, so suggestions > dh> are very welcome

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

2003-12-02 Thread Richard Davey
Hello Daniel, Tuesday, December 2, 2003, 10:46:33 PM, you wrote: dh> For generation of a random string with length 1.000.000 it takes about dh> 13 seconds on my xp 1600+.. that's quite a lot, imho, so suggestions dh> are very welcome.. Just so we're clear on this - you're creating a string (an e

Re: [PHP] replace a chunk peace of string

2003-12-01 Thread Curt Zirzow
* Thus wrote ada ([EMAIL PROTECTED]): > > What do you mean trim() doesn't work? > > trim is a basic function that remove spaces on the left and the right at the > string : > " abc"->"abc" trim() removes more than spaces, please read: http://php.net/trim What I meant in my original post wa

Re: [PHP] replace a chunk peace of string

2003-12-01 Thread ada
> What do you mean trim() doesn't work? trim is a basic function that remove spaces on the left and the right at the string : " abc"->"abc" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] replace a chunk peace of string

2003-12-01 Thread Curt Zirzow
* Thus wrote ada ([EMAIL PROTECTED]): > select hex("a > ") > -> > 610D0A > always 0D0A at the ends :( > > I' m on windows, and i didn't manage to destroy this peace of string :( > trim() doesn't work ... What do you mean trim() doesn't work? Curt -- If eval() is the answer, you're almost cert

Re: [PHP] replace special chars

2003-11-05 Thread John W. Holmes
Victor Spång Arthursson wrote: Are there any good function to replace special characters, for example double qoutes, with something that are more html-safe? If only the PHP gods would bless us with a function such as htmlspecialchars() or maybe even htmlentities()... what a great world it would

Re: [PHP] replace special chars

2003-11-05 Thread Victor Spång Arthursson
2003-11-05 kl. 16.07 skrev Pavel Jartsev: Try "htmlspecialchars()" and/or "htmlentities()". htmlentities() did it best! Thanks, /.v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] replace special chars

2003-11-05 Thread Pavel Jartsev
Victor Spång Arthursson wrote: Are there any good function to replace special characters, for example double qoutes, with something that are more html-safe? For example: The above is generated with PHP and fetched from a database (postgresql). I'ld like to have the double qoutes replaced with

RE: [PHP] replace special chars

2003-11-05 Thread Jay Blanchard
[snip] Are there any good function to replace special characters, for example double qoutes, with something that are more html-safe? [/snip] http://www.php.net/str_replace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] replace question

2003-03-12 Thread WebDev
- Original Message - From: WebDev <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 12, 2003 1:24 AM Subject: Re: [PHP] replace question Hello How could I know recognize a URL in $a $a contains often a URL htp://www.mysite.com but as well more tex

Re: [PHP] replace question

2003-03-12 Thread WebDev
- Original Message - From: WebDev <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 12, 2003 1:24 AM Subject: Re: [PHP] replace question Hello How could I know recognize a URL in $a $a contains often a URL htp://www.mysite.com but as well more tex

RE: [PHP] replace question

2003-03-11 Thread John W. Holmes
> how do we replace this out of an array element > > "~nl~" with " " How about str_replace()? Or are you talking about replacing that value in each and every element in the array? If so, use array_walk() or loop through the array and use str_replace(). ---John W. Holmes... PHP Architect - A

Re: [PHP] Replace illegal filename chars???

2002-10-24 Thread Shawn McKenzie
7;s allow punctation also...[:print:] > will cover this. > > Now only if php supported [:control:] and [:graph:] :) > > -Peter > > > -Original Message- > > From: Shawn McKenzie [mailto:nospam@;mckenzies.net] > > Sent: Friday, October 25, 2002 04:48 > >

RE: [PHP] Replace illegal filename chars???

2002-10-24 Thread Thoenen, Peter Mr. EPS
ported [:control:] and [:graph:] :) -Peter > -Original Message- > From: Shawn McKenzie [mailto:nospam@;mckenzies.net] > Sent: Friday, October 25, 2002 04:48 > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Replace illegal filename chars??? > > > Doesn't work. It retu

Re: [PHP] Replace illegal filename chars???

2002-10-24 Thread Shawn McKenzie
Doesn't work. It returned the same as what I put in: What's Up Doc? -Shawn "Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message news:20021024122630.4E99.MAXIM@;php.net... > > Use a regular expression like: > > $str = ereg_replce("/[^[:alnum:]]/i", '', $str); > > > -- > Maxim Maletsky > [EMAIL

Re: [PHP] Replace linefeed/newline from text inputs with tag?

2002-09-23 Thread David T-G
John, et al -- ...and then John Holmes said... % % Okay, you got me on that one, but why do you need to remove the In my case, I had a newline-delimited file of field@@data field@@data field@@data and when the data had an embedded newline like comment@@this is a long comment fiel

RE: [PHP] Replace linefeed/newline from text inputs with tag?

2002-09-23 Thread John Holmes
page explains this correctly, btw. It says that a "" will be inserted before all newlines. ---John Holmes... > -Original Message- > From: David T-G [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 23, 2002 7:10 AM > To: PHP General list > Cc: John Holmes; '

Re: [PHP] Replace linefeed/newline from text inputs with tag?

2002-09-23 Thread David T-G
John, et al -- ...and then John Holmes said... % % > If i have a textarea form input for users and they enter in return % spaces, % > how can i replace the ascci chars with html tags? % % It'd be great if they had a function for this...they could call it % nl2br() or something... Yeah. It wou

RE: [PHP] Replace linefeed/newline from text inputs with tag?

2002-09-22 Thread John Holmes
> If i have a textarea form input for users and they enter in return spaces, > how can i replace the ascci chars with html tags? It'd be great if they had a function for this...they could call it nl2br() or something... www.php.net/nl2br ---John Holmes... -- PHP General Mailing List (http://

Re: [PHP] Replace

2002-08-16 Thread Jason Reid
str_replace is your friend in this situation Jason Reid [EMAIL PROTECTED] -- AC Host Canada www.achost.ca - Original Message - From: "Alexander Lindstedt" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 16, 2002 6:05 PM Subject: [PHP] Replace > If i want to find just

Re: [PHP] replace question

2002-05-06 Thread Josh & Valerie McCormack
(This is more info on the question I asked before) Here's the text file (text.txt): This is a test of the templating program. Here's hoping it's working! John Smith Here's one line from the CSV file (new_data.csv): John,Smith,"4770 Rosepetal Ct., Richmond, VA 22032 USA",(703

Re: [PHP] replace question

2002-05-05 Thread Miguel Cruz
On Sun, 5 May 2002, Josh & Valerie McCormack wrote: > I'm iterating through a CSV file pulling in rows as arrays with fgetcsv > and I'd like to search for patterns made up of the first two array items > of each row with a space between them in a text file, and make them into > links. I can't fi

  1   2   >