Josh Time | Joshua Li

CAT | PHP

PHP5.3 comes out with a new anonymous function feature. This new feature adds a lot of new flexibility to PHP scripts. What caught my eye more is that a function can be stored inside a variable. Normal functions can not be unset. This is usually fine. But, when inplementing a plugin system to a php [...]

· · · ·

This is my first real PHP tutorial on this blog. I hope you enjoy it. Level: Easy Ending result: Item 1 | Item 2 | Item 3 | Item 4 Sometimes, a script may want to add a separator between items in a list. This is not as simple as it seems though. In this [...]

· · ·

Sometimes, a PHP script may want to keep track of how many times the page has been viewed. The normal solution would be to do: mysqli_query(“UPDATE `table` SET `views`=`views`+1 WHERE `page`=5″); But, what if your site gets very high traffic? Then, the MySQL would be overloaded. A fix to this would be to use a [...]

· · · · · ·

Jan/10

9

Faster alternative to settype()

I was working on Coal Games today and then I looked up settype. michaltrutman wrote this on http://php.net/manual/en/function.settype.php. You can change variable type also in another way instead of using function settype(). You can change variable type also in another way instead of using function settype(). <?PHP $a = ’125′; //$a is string var_dump($a); $a [...]

· ·

Theme Design by devolux.nh2.me