PDA

View Full Version : RE: Using Wildcards


philhowell
01-26-03, 18:48
Is it possible to use wilde cards in php...???

what i wish to do is cut out all the cr*p between hyperlinks and though something like this might work

$GooglenewHTML = str_replace("</a>*<a>", "</a>\n<a>", $Googlehtml);

What i'm trying to do ultimatly is create a meta search engine (i.e. a search engine that gets it's results from other search engines) and am struggling... so if any one know of a sample code i can use this would be ace.

But help on the wild card problem or another way to strip out just hyperlinks would be gratefully taken.

Thanxs
Phil

arfman
01-30-03, 05:15
create a fonction that read the string, search for the first <a> to the first </a> get the string inside, cut your string, ....

i don't think you have other solution in php.

bcyde
01-30-03, 12:08
You're going to want to look at regular expressions for what you're doing. Have a look at the following functions:

http://www.php.net/manual/en/function.preg-match.php
http://www.php.net/manual/en/function.preg-match-all.php
http://www.php.net/manual/en/function.preg-replace.php


-b