hy spend valuable time coding everything by hand? Using a framework is a great way to save time and effort on your next project—you’ll have a firm foundation to build upon, there will be pre-built modules to perform tedious coding tasks, and if you’re a learner, it’s a great way to learn about good coding practice. PHP’s massive popularity means that developers have a wide variety of frameworks to choose from. We’re sure you can find one amongst these... Read More »
Yii is a high-performance framework. The graph below shows how efficient Yii is when compared with other popular PHP frameworks. In the graph, RPS stands for "request per second" which describes how many requests an application written in a framework can process per second. The higher the number, the more efficient a framework is. As we can see that Yii outperforms all other frameworks in this comparison. The performance advantage of Yii is especially significant when t... Read More »
Array is probably the simplest compound data type every language supports. It’s basically a set of ordered values (text strings, numbers or booleans and even a child array). You can create an array in PHP by:[code]$companies = array('Microsoft', 'Google', 'IBM', 'Apple');[/code]Now array $companies contains 4 text string values. You can append one more by:[code]$companies[] = 'Dell';[/code]Or append yet another element that’s itself ... Read More »
To display numbers to end users, especially large numbers, you may need to format them to be more user friendly. For example, with a large integer 43386000.75, it is usually preferred to comma-separate every 3 digits to this:[code]43,386,000.75[/code]To format numbers this way in PHP, you need number_format() function:[code]print number_format(43386000.75); // prints '43,386,000.75'[/code]This is English notation of numbers with thousands separa... Read More »
Different number notations for different numerical bases:[code]0144 // base 8 100 // base 100x64 // base 16[/code]To convert between number bases, use PHP base_convert() function:[code]$hex = 'a1'; // hexadecimal number (base 16)$decimal = base_convert($hex, 16, 10); // $hex converted from base 16 to base 10 and $decimal is now 161[/code][code]$bin = '101'; // binary number (base 2)$decimal = ... Read More »
This way is so simple that anyone who’s a beginner in PHP can use it immediately to obfuscate and hide the original PHP code. Generally, it’d make it much harder for someone to find a specific phrase in your code as it’s encrypted, though in a rather simple way using 4 PHP functions: [code]gzinflate(), gzdeflate(), base64_encode() and base64_decode().[/code]For example, you can make it eventually impossible for someone who know nothing about PHP or programming to... Read More »
Programmers write programs for users so certain processes in the workflow can be automated for efficiency and correctness.As such, to improve the programming efficiency of similar projects for addressing a common set of related problems, such as the need for content management system in web authoring, some programmers write programming frameworks to integrate the bare bone workflow of a system that acts like a prototype. It is then on the prototype that more details are added and ... Read More »
Basically, PHP frameworks are programming layers that are promoted above PHP itself and that are much easier and quicker to deploy, normalizing and packaging 80% of the routines one is expected to work on without them, such as database interfaces. Therefore they free you from the chores of coding from very scratch line by line and do the common tasks that are shared among most of the projects for you.Like many other frameworks, PHP frameworks such as the Code Igniter and CakePHP a... Read More »
Zend Framework is very flexible and one of its strengths is that it allows developers to implement their own components. The Zend_Controller component, for example, is very powerful. Of course, it’s not my intention to replace it, but to offer an alternative that decreases the number of decisions a developer needs to make when developing an application.Meet Zf_Controller. The Zf_Controller component has the following goals: * Abstrac... Read More »
Meet TYPOlight, a powerful Web content management system that specializes in accessibility (back end and front end) and uses XHTML and CSS to generate W3C/WAI compliant pages.AccessibilityA growing number of countries around the world have introduced legislation which either directly addresses the need for websites to be accessible to people with disabilities, or which addresses the more general requirement for people with disabilities not to be discriminated against. TYPOli... Read More »