วันอาทิตย์ที่ 24 พฤษภาคม พ.ศ. 2552

PHP Cookie and "Cannot modify header information"

Today i use setCookie in my project and this code is the most top line
but they warning "Cannot modify header information"

I used ob_start(); but this code did not help anything

so for me i found this solution
Please check your all file encoding because this error happen with UTF8 with signature
(include have some strange line empty)

Change it to UTF8 without signature can help.
cheers.

วันจันทร์ที่ 11 พฤษภาคม พ.ศ. 2552

Unknow files (blank files) in Media Player 11 List

This files Can't access and Can't delete (if you selected all and remove all this file still be there)

simply solution is because Windows Media cache files

For vista
Goto

Local Disck > Users > XXX (Your User Name)>AppData>Local>Microsoft>Media Player

Delete All *.wmdb for manual reset cache Windows Media files

Now Go back to your Windows Media Player and see problem Unkonw files are gone

วันศุกร์ที่ 8 พฤษภาคม พ.ศ. 2552

PHP แปลงข้อมูลจาก String เป็นวันที่ (convert string to datetime)

ใช้เวลาเอาออกมาจาก MySQL ได้ผลดีนักแล เวลาเทียบเวลาใด ๆ โปรดใช้ timestamp นะครับ

MySQL Keep data in DateTime Format but read out in string.
To use that value try to convert to timestamp in PHP
and after on you go.

$str = 'Not Good';

// previous to PHP 5.1.0 you would compare with -1, instead of false
if (($timestamp = strtotime($str)) === false) {
echo
"The string ($str) is bogus";
} else {
echo
"$str == " . date('l dS \o\f F Y h:i:s A', $timestamp);
}
?>