Category Archives: PHP

PHP

Googling myself

Was thinking of a primary school classmate, typed in the name and returned a lot of result of various people, wonder what shows up now if I type in my Chinese name? (Yes I have done it before, years ago) And results are some PHP Dokuwiki plugins I wrote 9 years ago! Like… https://www.dokuwiki.org/plugin:tablemath, and this https://www.dokuwiki.org/plugin:autoincludeindex,… Read More »

Django vs. Laravel

After been through some tutorials of Laravel, it’s quite obvious that Django pwns Laravel in any day (if you know Python). There are a lot of manual process in Laravel that Django would have made it so easy, note this is not the same “black magic” that Laravel provides. Python vs PHP Since I am… Read More »

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