Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create .php files using php?

Tags:

php

What I'm trying to do is to make an installation file where the user enters the database, username, password, and host as a first step in a php system installation.

like image 792
Mohamed Said Avatar asked Jun 20 '11 13:06

Mohamed Said


People also ask

How do I create a PHP file in Windows 10?

Go to File > Save As… and save the file as "helloworld2. php", and open it in your browser by using the address: http://localhost/helloworld2.php. The output is the same as before, but this time the text is in bold. Make sure you save the file to your "server's" document root directory.

Does PHP need PHP file?

php" is neccessary if you want to write the php code, otherwise you can write the html only in php file without "<? php" .


1 Answers

It is same as you are creating other files but just add the extension .php

$fp=fopen('filename.php','w');
fwrite($fp, 'data to be written');
fclose($fp);
like image 113
Shakti Singh Avatar answered Sep 20 '22 14:09

Shakti Singh