create a php file through php code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
rajan
Forum Contributor
Posts: 110
Joined: Sun Aug 28, 2005 7:42 pm
Location: Lucknow, UP, India

create a php file through php code

Post by rajan »

Can i create a php file from php code like a text file? If yes then how
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

PHP files are after all text files, create them as you would other text files :roll:
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

Exactly, Just make a string that contains all the PHP code, and then just file_put_contents() it.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

FYI, file_put_contents() is PHP5
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

I know, but he didn't say he's using PHP4, did he?
And besides, using the PEAR Compat package, you get file_put_contents() for PHP4 as well.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

pilau wrote:I know, but he didn't say he's using PHP4, did he?
98% do
pilau wrote:And besides, using the PEAR Compat package, you get file_put_contents() for PHP4 as well.
much thanks, i will write my own ;)
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

n00b Saibot wrote:
pilau wrote:And besides, using the PEAR Compat package, you get file_put_contents() for PHP4 as well.
much thanks, i will write my own ;)
Sure, go ahead, you have my permission. ;)
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

pilau wrote:
n00b Saibot wrote:
pilau wrote:And besides, using the PEAR Compat package, you get file_put_contents() for PHP4 as well.
much thanks, i will write my own ;)
Sure, go ahead, you have my permission. ;)
I don't take permissions, I grant them :twisted:

Code: Select all

GRANT pilau PERMISSIONS FOR eating PULAO
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

Oh yeah? Well..

Code: Select all

GRANT `n00b saibot` PRIVILAGE TO 'newb'
Last edited by pilau on Sat Oct 01, 2005 8:40 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

enough off-topic nonsense.
Post Reply