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

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

2010-04-22 Thread Paul Halliday
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? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

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

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

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

2007-07-02 Thread Rahul Sitaram Johari
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 die("Fatal Error: Could not open database!

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

[PHP] replace single and double quotes

2006-08-29 Thread Reinhart Viane
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]"; Now both $_POST[editextra] and $_POST[editextrafr] can contain single or double quotes. So the query

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;

[PHP] replace

2005-09-19 Thread php @ net mines
Hi all if I have an array of chars to be replaced array(1,2,3,4,5); and an arry of chars to replace with array(a,b,c,d,e) what function do I need to replace all chars from one arry to the other that are found in the var $contents Thanks M -- PHP General Mailing List (http://www.php.net/)

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

[PHP] replace striing éèêà

2005-06-05 Thread John Taylor-Johnston
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">. I guess this below is a start. Is there a better way? John http://ca.php.net/manual/en/function.str-replace.php

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

[PHP] replace special characters

2005-02-24 Thread Frank Arensmeier
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 spreadsheet and look like "..\1 PDF Filer\65051.PDF". In my PHP code I try to do two t

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

[PHP] replace

2005-01-28 Thread blackwater dev
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 side of it. Currently, I just p

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://

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

2005-01-25 Thread Joe Harman
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. Thanks! Joe -- PHP General Mailing List (http://www.php.net/)

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

[PHP] Replace or regex?

2004-09-30 Thread mario
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, visit: http://www.php.net/unsub.php

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

[PHP] replace accents

2004-09-14 Thread Diana Castillo
Anyone know of any function to replace letters with accents with just the regular letter, for instance replace á with a, ç with c, ñ with n ? -- Diana Castillo -- 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 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

[PHP] Replace a button by an image

2004-07-30 Thread Henri Marc
Hello, Is it possible to replace a button by an image with PHP? Thanks! Dave Vous manquez d’espace pour stocker vos mails ? Yahoo! Mail vous offre GRATUITEMENT 100 Mo ! Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/ Le nouveau Yahoo! Messenger e

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

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

2004-07-25 Thread Turbo
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 -- PHP General M

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

2004-07-23 Thread C.F. Scheidecker Antunes
Hello all, If I have a string like this 123.456.789.01 , where dots are used to separate the thousands and the decimal part. How can I first detect this situation? More than one dot. I guess I could use str_word_count() from the manual, right? Then, once I have determined there are more than on

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] Replace space from form field using preg_replace

2004-03-17 Thread Vernon
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

[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

[PHP] Replace of ' in a query

2004-02-17 Thread carlos castillo
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 " or by chr(39) i dont know, and then execute the sql

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 q

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

[PHP] replace ' with "

2004-02-11 Thread Diana Castillo
How do I replace all single quotes with double quotes in a string for echoing it with the double quotes? -- Diana Castillo Global Reservas, S.L. C/Granvia 22 dcdo 4-dcha 28013 Madrid-Spain Tel : 00-34-913604039 ext 214 Fax : 00-34-915228673 email: [EMAIL PROTECTED] Web : http://www.hotelkey.com

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

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

2003-12-02 Thread daniel hahler
Hello PHP-list, I'm building a script, that provides a honeypot of invalid email addresses for spambots.. for this I want to provide a macro for the templates that looks like %rand[x]-[y]%, where [x] and [y] are integers, that specify the length of the random script. My first thoughts were about t

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

  1   2   >