The simple way to share the content of images and div in PHP is through regular expressions.
1. Get all the pictures in the webpage:
$text = file_get_contents (' http://www.jbxue.com/'// Preg_match_all $text $match //print_r($match?>
2. Get the first picture in the Web page:
PHP//$text=file_get_contents(' http://www.jbxue.com/'// preg_match$text$match); // Print out Match Print_r ($match);? >
3. Gets the specific div chunk data for the specified page:
PHP//$text=file_get_contents(' http://www.jbxue.com/'// preg_match('/]*id= ' postcontent ' [^>]*> (. *?)
/si ',$text,$match); // print out match[0] Print ($match[0]);? >
4. The above 2 and 3 are combined:
$text = file_get_contents (' http://www.jbxue.com/'// Preg_match ('/]*id= ' Postcontent "[^>]*> (. *?)
/si ',$text,$match//preg_match$text $match 2//print_r($match 2[0? >
http://www.bkjia.com/PHPjc/815972.html www.bkjia.com true http://www.bkjia.com/PHPjc/815972.html techarticle The simple way to share the content of images and div in PHP is through regular expressions. 1, get all the pictures on the page:? PHP//Get the content of the location address, and store ...