Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.
When projects are getting bigger, its always nice to split things up and prepare parts of your code for general reuse. PHP Traits (PHP 5.4+) are a nice way to do this. Adding multiple Traits or classes, requires you to make sure all are being included. Here is a nice way to register both with the __autoload function […]
Single inheritance has often been the limitation for PHP. This means that a class can only inherit from one other class. Often classes share the same methods and it would be beneficial to allow reuse and prevent duplication. In PHP 5.4 a new feature was added, known as Traits. A Trait is like a Mixin, allowing […]
header(‘Cache-Control: no-cache, must-revalidate’);header(‘Expires: Mon, 26 Jul 1997 05:00:00 GMT’);header(‘Content-type: application/json’); The first two headers prevent the browser from caching the response and the third sets the correct MIME type for JSON. Than just output your JSON data $data = array( “fire” => 1, “water” => 0, “earth” => 1, “air” => 1, ); echo json_encode($data); exit;
PORTALZINE® NMN
Alexander Gräf
Stettiner Str. Nord 20
DE-49624 Löningen