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
rajan
Forum Contributor
Posts: 110 Joined: Sun Aug 28, 2005 7:42 pm
Location: Lucknow, UP, India
Post
by rajan » Sat Oct 01, 2005 3:55 am
Can i create a php file from php code like a text file? If yes then how
n00b Saibot
DevNet Resident
Posts: 1452 Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:
Post
by n00b Saibot » Sat Oct 01, 2005 4:11 am
PHP files are after all text files, create them as you would other text files
pilau
Forum Regular
Posts: 594 Joined: Sat Jul 09, 2005 10:22 am
Location: Israel
Post
by pilau » Sat Oct 01, 2005 4:23 am
Exactly, Just make a string that contains all the PHP code, and then just file_put_contents() it.
n00b Saibot
DevNet Resident
Posts: 1452 Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:
Post
by n00b Saibot » Sat Oct 01, 2005 4:44 am
FYI, file_put_contents() is PHP5
pilau
Forum Regular
Posts: 594 Joined: Sat Jul 09, 2005 10:22 am
Location: Israel
Post
by pilau » Sat Oct 01, 2005 4:54 am
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.
n00b Saibot
DevNet Resident
Posts: 1452 Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:
Post
by n00b Saibot » Sat Oct 01, 2005 5:04 am
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 » Sat Oct 01, 2005 5:15 am
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.
n00b Saibot
DevNet Resident
Posts: 1452 Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:
Post
by n00b Saibot » Sat Oct 01, 2005 5:28 am
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
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 » Sat Oct 01, 2005 8:36 am
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Oct 01, 2005 8:39 am
enough off-topic nonsense.