Category Archives: PHP

PHP

Laravel for Django developers, part 3

During the last day of Christmas break I’ve spent a few hours trying to pick up Laravel again, from the beginning. I remember I blogged about Laravel back in 2016 (time flies!), and reading them again, I am surprised that what I thought back in 2016 still applies today. Today I am going to talk… Read More »

Writing static typed style code in dynamic type language

I am not sure who else is doing this but I have a static typed language background and I tend to write code in static type style. Don’t assign different value types to the same variable Let’s see what dynamic type in the simplest form in Python:

While this is perfectly legitimate, but it’s… Read More »

PHP developers should try Python.

PHP and Python both are dynamic typed language, so there is no point the discuss anything related in this aspect. Exception is first class citizen

Prints ‘Caught’ Let’s look at PHP:

Better functions Imagine you can write functions like this

Short-lived vs Long-lived Almost all PHP scripts are short-lived, including most frameworks, which… Read More »

Laravel for Django developers, part 1

Project Structure After setting up the quickstart project, I feel the project structure is quite different to Django. In Django a lot of code are organised in “app” domain, but it seems to me that multi-app is not something out-of-the-box in Laravel: https://laracasts.com/discuss/channels/general-discussion/laravel-5-multi-app-or-modular-applications Instead, it seems the apps in Django is more similar to the… Read More »

Laravel for Django Developers, prelude.

It appeared to me that “Laravel” is kind of similar to Django in the way of implementation concept, so this is my obvious choice. I did a google search “Laravel for Django developers” and got pretty much nothing useful, sure, who would have move back to PHP from Python? I think this only happens in… Read More »

PHP Snippet: Get dates from a given range

Result:



Category: PHP

PHP Tutorial: Server load bar chart

Server Load: Just a quick tutorial on drawing the server load bar chart in php: serverload.php

html

Category: PHP

My dokuwiki plugins

A while ago I wrote some dokuwiki plugins: User Home Page Auto Include Index Table Math Modal Popup ACL Made Easy

Category: PHP

How do you rotate a two dimensional array?

http://stackoverflow.com/questions/42519/how-do-you-rotate-a-two-dimensional-array This is the best so far I have come up with PHP, can anyone refine this for me??

Category: PHP