Create new pages dynamically using PHP

Suppose if you have a users data in your database and you stored in array variable $users.

For each user you want create a html page so you can do like this
<?php
// Creating a html page with user name
$fp = fopen( $user.".html", "w" );

// Writing the data to html
// $data is your data which you want to write
fwrite($fp, $data);

// Closing the file
fclose($fp);
?>

Hope this article helpful for you.

Post a Comment

Analytics