November 16th, 2007
admin
Programming is an art and science and like all art and science the only way to learn is from mistakes. I have made many… and I would like to share with you the mistakes that I have made over my journey with development.
Read more…
November 16th, 2007
admin
Here is a script that will allow you to print a nested array upto any level. Can I request you to please review this and let me know how this can be further optimized.
Read more…
November 15th, 2007
admin
In the tutorial we will understand what is Inheritance in general and how to inherit classes in PHP5.
Definition of Inheritance:
Inheritance is the mechanism of deriving a new class from an existing class. It allows a sub-class / child class to share/inherit the attributes and behaviors of a base-class or parent class. These inherited attributes and behaviors are usually modified by means of extension.
Read more…
November 15th, 2007
admin
In PHP4 the only constants that we would declare were global constants. In PHP5 it is possible to define a class level constant. These constants are specific to the class and hence don’t clutter the global level constant space.
Read more…
November 15th, 2007
admin
PHP5 introduces a new operator by the name of instanceOf. instanceOf is used to check if two objects passed as operands belong to the same class. This check can also happen when an object is compared with a class name.
In PHP4 a similar functionality existed with a method is_a(), which has been replaced by the instanceOf operator in PHP5.
Read more…
November 14th, 2007
admin
$this variable is a pointer to the object making the function call. $this variable is not avialable in static methods. We will learn more about static methods in the next series of tutorials.
Read more…
November 14th, 2007
admin
I have developed a function that you can embed in your PHP applications that will help you extract email addresses from a given piece of text.
I have tested this on a string of (actually 4 – 5 paragraphs) text and this has performed very well.
Please feel free to use this code in your applications and let me know if you face any issues.
Read more…
November 14th, 2007
admin
Refer to the code below which is a PHP5 Stack Class – an implementation of Stacks. You are free to use it in your programs.
Read more…
November 14th, 2007
admin
PHP5 Introduces Method Type Hinting. Type Hinting allows a function to force parameters to be objects of a particular class by specifying the name of the class in the function prototype.
Type Hinting is optional in all cases except catch block.
Read more…
November 14th, 2007
admin
In the earlier tutorials we have witnessed keywords like public, private and protected. These are nothing but access specifiers. So, lets understand what access specifiers are.
Definition of Access Specifiers
Access specifiers specify the level of access that the outside world (i.e. other class objects, external functions and global level code) have on the class methods and class data members. Access specifiers can either be public, private or protected.
Read more…