hello freinds i am new in php i am just learning can any body tell me what is the best use of function in PHP
Please adjust your font/size before posting. The best use of a function in PHP or in any language for that matter is to create a block of code or literally 'function' that will likely be executed more than once. A [useless] example is: function addone($v) { $v++; return $v; } This function adds 1 to whatever is passed to it. So, throughout your code you could use: $a = 1; $a = addone($a); $a now becomes 2
The best use of PHP function is to make it simpler than Java, in my words. PHP 5.0 is OOP language but it gives you the scope to write non-Object Oriented codes. PHP functions make the language easy and this is why experts in Java is more than that of Experts in PHP, but novice is PHP is quite a lot compared to Java.