Predefined functions... explained!

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

pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

hehe

function highlight_string($str)
{
$f = fopen('/tmp/tmp.txt','w');
fwrite($f,$str);
fclose($f);
return highlight_file('/tmp/tmp.txt');
}

flytyped for added sillyness
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post by qartis »

Should we disallow similar-functions in our new ones? I mean, print uses echo, and echo uses print..

See, here's my framework for echo():

-It prepares some nice antialiased fonts with styling and whatnot
-It opens up a connection to the X server with GD
-It spits the text out to the X server at the proper coordinates, in an entirely new desktop image running at 0:0 with alpha rendering

Er.. lemme try again:

-It connects to the ethernet port (fopen /dev/eth0)
-It intercepts the data stream being sent out to the client, rerouted to a nice big buffer
-It inserts its text, and transparently returns control to the php file


Any volunteers? :)
Post Reply