php anonymous functions

Get JSON data from PHP file

Having a PHP file spit out JSON as its main function can be really useful when you want to execute an AJAX call so you can refresh some content on the page, without reloading the page. Since the development of AJAX calls, a long wished dream was fulfilled for almost every web artisan. Being able to fully change parts of the content on a page without reloading everything was huge and certainly made each project more instant, direct and user...

Continue reading...

What does date() do in PHP?

Talking from experience, being able to manipulate time as developer is a great asset that many beginners and even senior developers fail to invest the time and effort to learn how it can be used effectively. With pretty much every system, there’s the need to work with timestamps and dates to keep track application cycles and recursive operations that may be executed in a period of time. What date() does is to create a string of the current unix timestamp...

Continue reading...

Anonymous and Named Functions in PHP

Developing large scaled web applications using PHP can become really hectic really fast if not utilize the most important structures of all, functions. Functions provide us the ability to re-use segments of code instead of writing them over and over again. Using functions we write the code block once and we can call it again again without worrying about chaotic consequences. Functions, apart from compatibility and re-usability, can enable scalability and maintainability of the code base and sometimes, if used...

Continue reading...