Help with script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #16
    Yeh, you were supposed to remove the foreach statement as it serves no purpose.
    [php]
    <?php

    $data = file_get_conten ts('http://thescripts.com' );
    $data = strip_tags($dat a,"<tr>");

    // now string becomes an array
    $data = explode("<tr>", $data);


    for($_i = 13; $_i < 17; ++$_i)
    {
    echo $_i. " " . $data[$_i] . "<br />";
    }



    ?>
    [/php]

    Comment

    • adamjblakey
      New Member
      • Jan 2008
      • 133

      #17
      Hi,

      Still does not work:

      [PHP]

      <?php

      // nine times we'll do the same things
      for($i=1;$i<10; $i++) {

      $data = file_get_conten ts('http://www.website.co. uk/details.asp?Org ID='.$i);
      $data = strip_tags($dat a,"<tr>");

      // now string becomes an array
      $data = explode("<tr>", $data);

      for($_i = 14; $_i < 17; ++$_i)

      {

      echo $_i. " " . $data[$_i] . "<br />";

      }
      }

      ?>
      [/PHP]

      Any ideas?

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #18
        It worked for me..

        Do you get any output, and errors?

        Comment

        Working...