Categories

Soundex function example

$word2find = ’stupid’;    $words = array(     ’stupid’,     ’stu and pid’,     ‘hello’,     ‘foobar’,     ’stpid’,     ’supid’,     ’stuuupid’, [...]

Basic watermarking example

<?php   header("Content-type: image/jpeg");   // get image file $img_name = "test.jpg"; $img_src = imagecreatefromjpeg($img_name); $width_src = imagesx($img_src); $height_src = imagesy($img_src);   // new image size = old [...]

PHP and GTK example

<?php       class GUI extends GtkWindow {           /*          * Class constructor          *          *    @param int $width        window width          *    @param int $height        window height          *    @param [...]

Get bluray release dates

<?php   if(isset($_GET['movie'])) {     $pdata = $_GET['movie']; } else {     die(""); }   if (strlen($pdata) < 5) { die("At least 5 letters in search."); }   [...]

Force a file to download

 

function downloadFile($file){         $file_name = $file;         $mime = ‘application/force-download’;     header(‘Pragma: public’);     // required     header(‘Expires: 0′);        // no cache     header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0′);     header(‘Cache-Control: private’,false);     header(‘Content-Type: ‘.$mime); [...]