# Strip URL Content and Grab the Data

**URL:** <https://forum.kirupa.com/t/strip-url-content-and-grab-the-data/267284>\
**Category:** programming\
**Created:** [July 30, 2008, 10:59am UTC](https://forum.kirupa.com/t/strip-url-content-and-grab-the-data/267284 "2008-07-30T10:59:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benghee](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@benghee](https://forum.kirupa.com/u/benghee)\
**Post date:** [July 30, 2008, 10:59am UTC](https://forum.kirupa.com/t/strip-url-content-and-grab-the-data/267284/1 "2008-07-30T10:59:55Z")

</div>

Hi all, I have this URL that display date and news title. All i need is grab only **news title** and direct it on my another site. So far, i have done stripped the date and title but have no idea how to grab only the one i need. Just a few steps away i can be done my job, does anyone here can helping me out? Many thanks 🙂

This is the URL php file:

```php

//Some php and html code here..
<table width="100%" cellpadding="0" cellspacing="0" border="0"> 
    <?php foreach($news as $data){ ?>
    <tr class="black_navi_link">
     <!-- Date display -->
     <td width="75"><?php echo substr($data['Date'],8,2).$news_title['day'][$lang].substr($data['Date'],5,2).$news_title['month'][$lang]; ?></td>
     <!-- Title display -->
     <td width="2"></td>
     <td><a href="javascript:news();" onClick="javascript:ShowNews('<?php echo $data['ID']; ?>');">
     <?php if(strlen($data['Title'])>48){ echo substr($data['Title'],0,48).'...'; }else{ echo $data['Title']; } ?></a></td>
    </tr>
    <?php } ?>
//Some php and html code here...

```

This is stripped.php

```php

 $file = fopen(http://www.news_abc.com, "r");
 $news_to_load = 3;
 $max_loop = 5;
 $loop_times = $max_loop;
 $content = "<table width='100%' cellpadding='0' cellspacing='1' border='0'>";
 
 while ( !feof($file) && $news_to_load > 0 ){
  $str = fgets($file);
  if ( stristr($str, "<tr class=\"black_navi_link\">") ){
   $news_to_load = $news_to_load - 1;
   $content = $content . $str;
   while ( $loop_times > 0 ){
    $str = fgets($file);
    $str = str_replace("<a href=\"javascript:news();\" onClick=\"javascript:ShowNews('", "<anchor><go href='news.php?nid=", $str);
    $str = str_replace("');\"", "'", $str);
    $str = str_replace("</a>", "</go></anchor>", $str); 
    $content = $content . $str;
    $loop_times = $loop_times - 1;
   }
   $loop_times = $max_loop;
  }
 }
 $content = $content . "</table>";
 echo $content;

```
