Announcement

Collapse
No announcement yet.

How to make like this code in PHP ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to make like this code in PHP ?

    how can i convert this function ( Get ) to PHP format ?

    PERL :
    Code:
    #!/usr/bin/perl
    
    use LWP::Simple;
    
    $page = get "http://www.vbulletin";
    
    print qq|
    
    $page
    
    |;

  • #2
    use file()

    Use the file() function like so:

    PHP Code:
    <?php

    $fcontents 
    file ('http://www.cnunited.com');
    while (list (
    $line_num$line) = each ($fcontents)) {
        echo 
    "<b>Line $line_num:</b> " htmlspecialchars ($line) . "<br>\n";
    }

    ?>
    Hope this helps.

    -Vic

    Comment


    • #3
      Thank you

      Comment


      • #4
        Or try a shorter version of the code shown above:

        Code:
        echo implode("", file("http://www.vbulletin.com"));

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X