Bluehost.com Web Hosting $6.95

Re: [PHP] strings

This is a discussion on Re: [PHP] strings within the PHP General forums, part of the PHP Programming Forums category; * Thus wrote Anthony Ritter (tony@gonefishingguideservice.com): > Curt Zirzow wrote in message: > > > This exact thing was ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-02-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] strings

* Thus wrote Anthony Ritter (tony@gonefishingguideservice.com):
> Curt Zirzow wrote in message:
>
> > This exact thing was talked about earlier today, with the subject
> > 'Using eregi_replace()'.

> ........................
>
> Right.
>
> However, I've tried using the following code in which the text from the URL
> is printed out completely and then I change the variable from $contents to
> $text and using the line with preg_replace(), it still outputs the complete
> text without the pattern match.


hm.. I sort of misunderstood, preg_replace isn't what you need. use
preg_match instead.

I did some testing you can see the code and results here:
http://zirzow.dyndns.org/html/php/te.../parse_doc.php

> $newtext= preg_replace("!.*?(REGIONAL.*YORK).*!","$1",$text) ;

btw, there these should be single quotes ~~~~~~~~~~^ ^

or "\$1" so php doesn't expand the variable (even though its an
illagal php var name.)


HTH,

Curt
--
"I used to think I was indecisive, but now I'm not so sure."
Reply With Quote
  #2 (permalink)  
Old 08-02-2003
Anthony Ritter
 
Posts: n/a
Default Re: [PHP] strings

Curt Zirzow writes:
> I did some testing you can see the code and results here:
> http://zirzow.dyndns.org/html/php/te.../parse_doc.php

...................

Thanks Curt.

I checked it out and I still pick up the following lines which I was looking
to delete on the pattern match.

They are:
..............
Expires:No;;725283 //line 1
AWUS41 KALY 012014 //line 2
RWSALB // line 3
..................

It could be that when the URL file is being opened and read that these
characters are on _three_ different_ lines as opposed to one line/string and
the match is not being met.

I was looking to delete those lines and to start the match at REGIONAL.

Best...
TR



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:02 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0