Categories

Category Specific RSS

PHP and GTK example

<?php       class GUI extends GtkWindow {           /*          * Class constructor          *          *    @param int $width        window width          *    @param int $height        window height          *    @param int $title        title bar text          *          */           public function __construct($width=400, $height=200, $title="PHP-GTK GUI") {             // Call […]

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInBaiduApp.netBufferDeliciousDiggDiigoWordPressBlogger PostEmailPrintFriendlyShare

List images in a folder

// the directory, where your images are stored $imgdir = ‘/images/’;   // list of filetypes you $allowed_types = array(‘png’,’jpg’,’jpeg’,’gif’); want to show   $dimg = opendir($imgdir); while($imgfile = readdir($dimg)) { if(in_array(strtolower(substr($imgfile,-3)),$allowed_types)) { $a_img[] = $imgfile; sort($a_img); reset ($a_img); } } // total image number $totimg = count($a_img);   for($x=0; $x < $totimg; $x++) { […]

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInBaiduApp.netBufferDeliciousDiggDiigoWordPressBlogger PostEmailPrintFriendlyShare

Latest weather using PHP

<?php    $xml = simplexml_load_file(‘http://www.google.com/ig/api?weather=ADDRESS’);   $information = $xml->xpath("/xml_api_reply/weather/current_conditions/condition");   echo $information[0]->attributes(); ?>

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInBaiduApp.netBufferDeliciousDiggDiigoWordPressBlogger PostEmailPrintFriendlyShare