Jump to content

strip tags


dreamwest

Recommended Posts

Im trying to seperate a group of hyperlinks, but cant seem to do it

 

<a target="_self" href="http://site.com/index.php?q=search">search</a>

<a target="_self" href="http://site.com/index.php?q=search2">search2</a>

<a target="_self" href="http://site.com/index.php?q=search3">search3</a>

 

Basically i want to strip everything away except what between the hyperlink tags so it looks like this:

 

search

search2

search3

 

 

Link to comment
https://forums.phpfreaks.com/topic/173394-strip-tags/
Share on other sites

<?php
$oldString = '
	<a target="_self" href="http://site.com/index.php?q=search">search</a>
	<a target="_self" href="http://site.com/index.php?q=search2">search2</a>
	<a target="_self" href="http://site.com/index.php?q=search3">search3</a>
	';
$newString = strip_tags($oldString);
print($newString);
?>

Link to comment
https://forums.phpfreaks.com/topic/173394-strip-tags/#findComment-914077
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.