1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Rep Power
    Hey guys,
    I just started to learn PHP, and I have a strong background Borland Delphi and HTML. But, I am new to this so i was hoping someone could help me out. Are their procedures? Like you have...

    function what($var) {

    and in perl you can do a simple procedure without variables like

    sub whatever{

    What would the 'sub' be equivilent to in PHP? I have a error message I want posted throughout a page if there are form errors, and i know i can just do include but I would rather use a procedure, at least to learn how its done. Here's the code im using...maybe i just messed up the syntax or something...

    sub ErrorMsg {
    echo "error message here";

    Hope someone can help me out,
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Niagara Falls (On the wrong side of the gorge)
    Rep Power
    Just define it without arguments, but you do need to include the ():

    function some_func()
    do foo

    then call it with


IMN logo majestic logo threadwatch logo seochat tools logo