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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.