Your Ad Here

Home » PHP Code »

1

The following script to copy the text from remote url using php code.

<?php
$regex = '/]*>(.*<\/body>/smi';
 
/*END config, BEGIN html*/
 
$data = file_get_contents($siteName) or die('Cannot read ' . $siteName);
 
preg_match($regex, $data, $cleanData);
 
if(!empty($cleanData))
 
$data = $cleanData[1];
 
echo $data;
 
?>
 
<!-- HTML Footer Data here... -->

This is simple copy text from another site, but it will be useful for who are new to php.


You may like these posts

    How to take backup of Database using PHP code?What is cron job ? How to set the cron job in PHP?PHP Captcha and reCaptcha options for web forms using javascriptHow to connect to FTP and upload file using php code?

 

1 Comment

  1. Thanks, I’m working on a text parsing script for MySQL and this helped me out alot!!

Leave a Reply