Tag Archives: PHP

PHP CURL: Fetch Web Page Contents with Status Code

Basic implementation Copy-paste this function to get contents of a web served file / document from given URL. Note: CURL needs to be enabled on your system. function curl_get_contents( $url ) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return array($http_status,$response); } Usage example $url […]

Continue reading

Turing Machine Simulation written in Javascript and PHP

Few years back I’ve been working on a Turing machine implementation in PHP and Javascript. Try out the javascript animated simulation first and then continue reading. Turing machine animated simulation START SIMULATION (press F5 to restart) Delay (1/speed): 30 ms of delay More delay (slower) | Less delay (faster) The Turing machine definition: This file […]

Continue reading

InVision Framework: The View Template Language

Many modern web applications follow the Model-View-Controller pattern in order to separate concerns, or in detailed terms: to avoid mixing the backend processes, business logic, the data structuring and the way all gets displayed to the user. Following this pattern I have developed a simple language which is quite neat, easy to use and understand […]

Continue reading