Results 1 to 1 of 1

Thread: [Resolved] Get info between two points

  1. #1

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    [Resolved] Get info between two points

    how would i (in php) get all the info between these two functions from a webpage?

    PHP Code:
    <?php 

    $Page 
    fopen("http://www.bom.gov.au/","r"); 

    //<div id="pad">
    //</div>    

    function remover($string$sep1$sep2)
    {
           
    $string substr($string0strpos($string,$sep2));
           
    $string substr(strstr($string$sep1), 1);
           return 
    $string;
    }
    $str1 "<div id=""pad"">";
    $str2 "</div>";
    echo 
    remover($Page$str1$str2);

    ?>





    I also edited it a bit further and ended up with nothing much more,
    PHP Code:
    <title>Test PHP script</title>
    <meta http-equiv="refresh" content="60">
    </head><body>
    <p><strong>Current Forecast for today; </strong></p>
    <p>







    <?php 


    $Page 
    fopen("http://www.bom.gov.au/","r"); 
    if(
    $Page){ 
       while (!
    feof($Page)) { 
       
    $contents .= fread($Page8192);} 
    fclose($Page);}


    /*
    Note


    Weather:

    Gets from <div id="pad"> to </div> from the BOM website.




    Clock:

    http://www.worldtimeserver.com/clocks/wtsclock001.swf?color=00FF00&wtsid=US-UT
    Based on original SWF file, all changes are in the inside the file.

    wtsid=AU-SA is South Australia, Australia

    */    


    function GetForecast($string$sep1$sep2)
    {
           
    $string substr($string0strpos($string,$sep2));
           
    $string substr(strstr($string$sep1), 1);
           return 
    $string;
    }


    /*


    function GetRank($skill)    
    {    $str1 = strstr($GLOBALS['contents'], '>'.$skill.'<');
        if(strpos($str1, 't"')>40){return '';}
        $pos1 = strpos($str1, 't"')+3; 
        return substr($str1, $pos1, strpos($str1,'<',$pos1)-$pos1);} 
    */


    //echo GetForecast($Page, "<div id=""pad"">","</div>");




    //Boring image


    ?>
    </p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p><?php
          
          
    //Beginning
          // 
          //<div class="annotation" style="margin: 2px 0pt;">or Click map, to link to weather area </div>
          //
          //
          //End
          //
          //"<table"
          //Echo image      
          
    ?>
    </body>
    </html>



    please, ive tried this but it wont work properly, can any one help?
    cheers

    i couldnt figure out how to delete a post so i just marked it resolved. its fixed btw
    Last edited by Jazz00006; Jul 10th, 2006 at 11:19 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width