|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
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) { blah } and in perl you can do a simple procedure without variables like sub whatever{ blah } 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, -Bryan |
|
#2
|
|||
|
|||
|
Just define it without arguments, but you do need to include the ():
function some_func() { do foo } then call it with some_func(); |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > On quick question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|