Niaad
March 22nd, 2001, 16:02
I know a little bit of CGI, and one of the things that I do know is to make a sub, you do this:
sub TheSub {
print "This is a sub!";
}
And then to call it...
&TheSub
Well, recently I have been working a lot more with PHP, because I find it a lot easier. Anyway, I tried using code like that in PHP (considering a lot of CGI code is exactly the same in PHP), but I kept getting parse errors on the line "sub TheSub {". I went searching for any PHP tutorials that had information regarding this, but I couldn't find anything.
I am just curious, is there a different way of doing it in PHP? Or is it just not possible at all?
sub TheSub {
print "This is a sub!";
}
And then to call it...
&TheSub
Well, recently I have been working a lot more with PHP, because I find it a lot easier. Anyway, I tried using code like that in PHP (considering a lot of CGI code is exactly the same in PHP), but I kept getting parse errors on the line "sub TheSub {". I went searching for any PHP tutorials that had information regarding this, but I couldn't find anything.
I am just curious, is there a different way of doing it in PHP? Or is it just not possible at all?