![]() |
|
|||||||
| Register | FAQ | Members List | Downloads | Calendar | Today's Posts | Search | Webmaster Resources | Webmaster Blogs |
![]() UK Web Hosting |
![]() Website Hosting |
![]() UK One Way |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
A Quick Guide to PHP Functions.
What is a function? A function is a way of repeating PHP code over and over again quickly and easily. Instead of having 20 lines of code repeated 5 times, you use the 20 lines of code once, and repeat 1 line of code 5 times. Ok. Now you understand exactly why functions are so useful, I’ll go into a bit more detail about how they can be used. To create a function, type: PHP Code:
You can have a simple function like this: PHP Code:
PHP Code:
PHP Code:
PHP Code:
If you want to assign the function to a variable, you can easily, just like you would for most variables. PHP Code:
PHP Code:
PHP Code:
PHP Code:
Remember – It’s not about reading this, to learn anything you must type the code out for yourself. Jack |
![]() |
| Bookmarks |
| Webmaster Resources |
| • UK Web Hosting • UK WW SEO Tools • Free site submission • Web Directory |
| Advertisement |
|
| Site Of the Month |
![]() Nominate site of the month |
|
|
| UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons. |
| Subscribe to our feeds |