Below is a brief tutorial on how to use PHP functions. The purpose of functions is to run a series of statements without having to duplicate the code several times. This makes your program neater and easier to interpret.
Here is an example:
<?php
class test {
public function hello() {
echo "hello world";
}
}
$test1 = new test;
$test1->hello();
?>
Your browser should read 'hello world'.
Check out my car info app in the iTunes App Store
No comments:
Post a Comment