|
|
|
| Title : |
PHP function which gets all the data from a webpage into a string, we can perform regular expression functions on that data afterwards to get our desired data.
|
| Categories : |
PHP, URLs, HTML and PHP |
 Mohammad Makki |
| Date : |
Sep 27th 2001 |
| Grade : |
3 of 5 (graded 6 times) |
| Viewed : |
7799 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by Mohammad Makki |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
/*
* File name: Your_File_name
* Description: PHP Scripts which gets the data from the
* Any website and we can perform regular expression funtions
* on that data afterwards to get our desired data.
* Author: Mohammad Asim Makki : densefunctions@hotmail.com
* Web Developer PHP/JAVA
* Nettech Limited --- Silcon Ways
*/
function getData($URL){
//Giving the String URL as argument it returns all webpage as a String to you
$allPage = "";
if($URL == null){ //Checking provided URL
echo("<b><font color=\"red\">Please specify a URL to get data from </font></b>");
}
$fp= fopen($URL, r); //Opening Connection
if ( !$fp ) { // Check connection
echo("<b><font color=\"red\">Connection Failed</font></b>");
}
else{
$num=0;
while ( !feof($fp) ){
$pageText[$num] = fread($fp,1024);// read WebPage
$num++;
}
//endwhile;
}
$arrayLen=count($pageText);
for($i=0; $i<$arrayLen; $i++){
$allPage=$allPage.$pageText[$i];
}
fclose($fp);
return $allPage;
}
//===Example of usage of function===
echo(getData("http://www.msn.com/")); |
|
| PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use! Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP | | | Save time debugging PHP3 under UNIX/Linux using linked .phps files Categories : HTML and PHP, Debugging, PHP | | | PHPLinkRot v1.0 - program which allows users to report broken links on
your website just by clicking a button. Works well on custom 404 pages Categories : PHP, Complete Programs, Debugging, URLs, Site Planning | | | How To Create a PDF Using PHP Categories : PHP, PDF, PHP Classes, HTML and PHP | | | Popup Menu 0.5, popup, select, html, state-maintaing Categories : HTML, PHP, HTML and PHP | | | Paginating the mySQL data Categories : PHP, Algorithms, Databases, MySQL, HTML and PHP | | | Class to build a select tag in html, useful to build select boxes from a data base Categories : PHP, HTML and PHP, PHP Classes | | | Convert date's in YYYY-MM-DD (i.e. mysql format) into PHP3 timestamps. Also Find the difference in days between two PHP3 timestamps. Categories : HTML and PHP, PHP, MySQL, Date Time | | | php jump urls...the best way Categories : PHP, URLs, Filesystem | | | Remove URL Parameter Substr Strstr Categories : PHP, URLs, Strings | | | XDT Topsite (Gold v1.0) Categories : Databases, CSS, PHP, HTML and PHP, Sessions | | | Gonx URLs - This class is meant to generate URLs for accessing application dynamically generated pages based on parameters passed in the URL.
Categories : PHP, PHP Classes, Navigation, URLs | | | php table decoder used to convert an html table to individual tokens
through regular expressions Categories : PHP, Regexps, HTML and PHP | | | Handle multiple file upload Categories : Complete Programs, Filesystem, PHP, HTML and PHP | | | Directory viewer, customize how you display the file structure, easy to
understand. Found out about PHP 3 days ago, and this is my first prog. Categories : HTML and PHP, Complete Programs, Directories, Filesystem, PHP | |
| | | | shlomi loubaton wrote :712
This doesn`t work with https://
do you know how can i fix it for https ???
| |
|
|