Get the width of an image using PHP

Posted: January 17, 2011 in PHP5
Tags:

<?php
list($width) = getimagesize(“5118-4XAwWL._SL110_.jpg”);
echo “Image width: ” .$width;
?>

Advertisements

< ?php

define('SALT', 'whateveryouwant');

function encrypt($text)
{
return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SALT, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
}

function decrypt($text)
{
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SALT, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
}

$encryptedmessage = encrypt("your message here");
echo decrypt($encryptedmessage);

? >

< head >
< meta http-equiv=”refresh” content=”5; URL=page_name.htm” >
< /head >

Bangladeshi Today Date With Time in PHP

Posted: January 12, 2011 in PHP5
Tags:


$day = gmdate("d");
$month = gmdate("m");
$year = gmdate("Y");
$hour = gmdate("H")+6;
$minute = gmdate("i");
$second = gmdate("s");
$today_date=@date("d-m-Y H:i:s", mktime ($hour,$minute,$second,$month,$day,$year));
echo "Today Date:".$today_date;

Calculate Bangladesh Today Date with PHP

Posted: January 12, 2011 in PHP5
Tags:


$day = gmdate("d");
$month = gmdate("m");
$year = gmdate("Y");
$today_date=@date("d-m-Y", mktime (0,0,0,$month,$day,$year));
echo "Today Date:".$today_date;