Re: [PHP] Really simple regex

2005-06-09 Thread Dotan Cohen
On 6/8/05, John Nichel <[EMAIL PROTECTED]> wrote: > preg_replace ( "/x+/", "x", $string ); > preg_replace ( "/x{1,}/", "x", $string ); > > But those will also change a letter 'x' in a word, so you'll probably > need to tinker with that part too. > > -- > John C. Nichel > ÜberGeek > KegWorks.com >

Re: [PHP] Really simple regex

2005-06-09 Thread Jochem Maas
... $string="I have apples!"; $string=preg_replace("/x+/sim","x", $string); print "$string"; ... Thanks, that did it. I did not know about the +. And what is the 'sim' its not one thing but 3 things, everything that comes after a regexp closing marker (but inside the string) is

Re: [PHP] Really simple regex

2005-06-08 Thread John Nichel
Dotan Cohen wrote: Now, I know that this is easy, but I am embarassed to say that I can't find a regex tutorial that will show me how to match any occurances of x and replace them with one x: x >x xx > x x > x $string="I have apples!"; $string=preg_replace("-regex here-","x", $stri

Re: [PHP] Really simple regex

2005-06-08 Thread Dotan Cohen
On 6/8/05, Jochem Maas <[EMAIL PROTECTED]> wrote: > Dotan Cohen wrote: > > On 6/8/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > >>Quoting Dotan Cohen <[EMAIL PROTECTED]>: > >> > >>$string="I have apples!"; > >>$string=preg_replace("/x+/sim","x", $string); > >>print "$string"; > >>

Re: [PHP] Really simple regex

2005-06-08 Thread Jochem Maas
Dotan Cohen wrote: On 6/8/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Quoting Dotan Cohen <[EMAIL PROTECTED]>: $string="I have apples!"; $string=preg_replace("/x+/sim","x", $string); print "$string"; hope it helps.. Now, I know that this is easy, but I am embarassed to say th

Re: [PHP] Really simple regex

2005-06-08 Thread Dotan Cohen
On 6/8/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Quoting Dotan Cohen <[EMAIL PROTECTED]>: > > $string="I have apples!"; > $string=preg_replace("/x+/sim","x", $string); > print "$string"; > > hope it helps.. > > > Now, I know that this is easy, but I am embarassed to say that I

Re: [PHP] Really simple regex

2005-06-08 Thread Matthew Weier O'Phinney
* Rory Browne <[EMAIL PROTECTED]> : > preg_replace("/x+/", "x", $string); should do it. Having that said, > regex generally comes back and bites me in the ass, so... That one won't -- that's spot on. > On 6/8/05, Dotan Cohen <[EMAIL PROTECTED]> wrote: > > Now, I know that this is easy, bu

Re: [PHP] Really simple regex

2005-06-08 Thread Rory Browne
preg_replace("/x+/", "x", $string); should do it. Having that said, regex generally comes back and bites me in the ass, so... On 6/8/05, Dotan Cohen <[EMAIL PROTECTED]> wrote: > Now, I know that this is easy, but I am embarassed to say that I can't > find a regex tutorial that will show me

Re: [PHP] Really Simple

2003-09-25 Thread Becoming Digital
I'm not sure what the problem is. Everything's working smoothly on my end. Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: "Kaan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, 25 September, 2003 13:08 Subject: [PHP] Rea

Re: [PHP] Really simple string search question

2003-03-16 Thread Kevin - KD Micro Software
> To: "'Kevin - KD Micro Software'" <[EMAIL PROTECTED]>; "'PHP List'" <[EMAIL PROTECTED]> Sent: Monday, March 17, 2003 8:58 AM Subject: RE: [PHP] Really simple string search question > > Here's 3 examples: > > $var="www.

RE: [PHP] Really simple string search question

2003-03-16 Thread John W. Holmes
> Here's 3 examples: > $var="www.google.com"; > $var="blah blah google blah"; > $var="google rules"; > > Now I just want to see if $var contains the word 'google' in it - which www.php.net/strstr ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today.

Re: [PHP] really simple problem with GET

2003-03-12 Thread Hugh Danaher
Kevin, first, change your URL statement to: http://.../test.php?test=1 // the $ is not needed. second, use $test=$_GET['test'] to get the transferred value into $test. then, echo $test and see if it works. Hugh - Original Message - From: "Poon, Kelvin (Infomart)" <[EMAIL PROTECTED]> To:

Re: [PHP] really simple problem with GET

2003-03-12 Thread Ray Hunter
You form tag should be passing the get request to the php script. example: ... In test.php all should work now... -- Ray On Wed, 2003-03-12 at 11:04, Poon, Kelvin (Infomart) wrote: > Hi, > > I am sorry if the level of this question is too simple but I can't figure > out what's wrong. I w

Re: [PHP] Really simple question - /php directory above /web tree .htaccess contents

2003-03-08 Thread Ernest E Vogelsinger
At 17:58 08.03.2003, news.php.net said: [snip] >I want to have the /php directory >one directory above the /web root >so it is not accessible from browser command line execution but >will execute from a click on an >html page. CGI-PHP is installed >but I nee