Jump to content

please help me on handling this string problem.


mars_rahul

Recommended Posts

here is the actual code.

 

 

<?php
$string = $row['Body_html'];
/*$string wiill contain : - <p><a href="http://www.thefullmonte.com">thefullmonte.com</a></p> I came
to Afghanistan to cover the first-ever democratic elections with an American documentary film team. In 
the weeks leading to the Afghan elections the Taliban vowed bombings and kidnappings. However, the 
only excitement over the month of campaigning and Election Day was that from the Afghan people rallying 
for their candidates.<p>With a week left before I was to leave Afghanistan, I had planned a 3-day trek to 
Bamiyan with my colleague, John Monte, a cameraman. Kabul had become a fortress city where dwellings 
were not called homes or offices, but compounds with 2 to 3 guards holding AK-47s. There was a slight 
tension in the air. International security forces, ISAF, rumbled through the city in armored personnel 
carriers and Humvees swinging 70 caliber machine guns. And there was a constant buzz of Apache attack 
helicopters above.</p>*/


// from the above string i need to extract hyperlink (<a>) tag with its content.

//output of above must be : -<a href="http://www.thefullmonte.com">thefullmonte.com</a>

?>

please help me out

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.