PDA

View Full Version : trying not to resort to "HELP PLEASE!!!!!"


Phip
12-02-2002, 05:03 AM
I've asked this at just about every forum i go to. no one even repleys. How on earth do i do this? I've been trying all kind of ways and and they all prove wrong. i'm stuck.


I've been trying to figure this out for a long time. how can i take:

<a href="http://domain.com/news/?=1" target="_blank">blah blah blah</a>

to:

blah blah blah

i'm not even sure what functions i should use for this. i am assuming preg_replace. any help would be cool. Thanks.

Ankun
12-02-2002, 05:49 AM
Well i'm sure part of the problem is that you are making thread topics like this..nobody has any clue what you are asking when you make topics so undescriptive..anyway..about what you need

I think you need to make variables for the url and the text and then write a variable for [link=] to be equal to <a href=> and [link] to be equal to </a>.

There are TONS of scripts like this out on the net already, why not just find one of those to use for referance?

mordred
12-02-2002, 03:27 PM
Try this:


$result = preg_replace(
'/^\<a href\="(.+?)"(.+?)\>(.+?)\<\/a\>$/i',
'\\3',
$test
);


alternatively, you could also apply XML parsing for this task. Though it might be kind of overkill depending on your project.