|
|
|
| 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 : |
15147 |
| 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 | | | URL validator and reformatter Categories : PHP, URLs | | | Sql Builder Categories : PHP, HTML and PHP, Databases, General SQL, Form Processing | | | GonxTabs : Create elegant HTML tabs based interface Categories : Navigation, HTML, HTML and PHP, PHP | | | Form Security - Match A Value For Success Categories : PHP, Authentication, HTML and PHP, Sessions, Security | | | Class to Create protected URLs Categories : PHP, PHP Classes, URLs | | | Tag content retrieval from websites with preg_match Categories : PHP, Regexps, Arrays, HTML and PHP | | | getting the name of the current script and query string Categories : PHP, Global Variables, Variables, URLs | | | PHP Script to find url links in a page Categories : PHP, URLs, Regexps, Arrays | | | navbar.php3 - Dynamic hyperlinked navigation bars Categories : HTML and PHP, Arrays, PHP, Complete Programs | | | Editing the virtusertable and sendmail.cw via PHP3.0 and Mysql Categories : MySQL, HTML and PHP, PHP, Databases | | | PHP5 URL Object Categories : PHP, PHP Classes, URLs, Strings | | | This function will populate the options in a drop down HTML select list
in a form from a database query.
Categories : MySQL, General SQL, PHP, HTML and PHP, Databases | | | Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | class formHTML build your HTML Forms from PHP Categories : PHP, PHP Classes, HTML and PHP, HTML | |
| |
| | | | | shlomi loubaton wrote :712
This doesn`t work with https://
do you know how can i fix it for https ???
| |
|
|