|
|
|
| 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 4 times) |
| Viewed : |
5295 |
| 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 | | | Message of the Day - Random Message (Needs MySQL!) Categories : Databases, HTML and PHP, PHP, MySQL | | | A simple class with some HTML output functions that would come in handy for consistent page layout etc. Categories : PHP, PHP Classes, HTML and PHP, HTML, Navigation | | | a function that builds an HTML select list from any mysql table. Categories : PHP, MySQL, HTML and PHP | | | Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms, HTML and PHP, PHP, Variables | | | Constantly refresh your PHP/HTML page data. Categories : PHP, HTML and PHP, Sybase | | | PhpView 0.1 - simple php viewer, using temporary files and frames.
Categories : PHP, PHP Options and Info, Debugging, HTML and PHP | | | Automatically printing the contents of an sql table in MySQL. Categories : MySQL, PHP, HTML and PHP, Databases | | | background music script for random notes in a frame Categories : PHP, Content Management, HTML and PHP | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | PageRank Display Categories : Search Engines, HTML and PHP, PHP | | | Dynamic Calender in PHP, Javascript and HTML. Categories : PHP, Java Script, HTML and PHP, Calendar | | | php jump urls...the best way Categories : PHP, URLs, Filesystem | | | Using select multiple with php3 Categories : HTML and PHP, PHP | |
| | | | shlomi loubaton wrote :712
This doesn`t work with https://
do you know how can i fix it for https ???
| |
|
|
|