Hi
how to convert unixtimestamp to date using php functions.help to solve this problem
| SitePoint Sponsor |
Hi
how to convert unixtimestamp to date using php functions.help to solve this problem

datePHP Code:echo date('Y-m-d H:i:s', $myTimestamp);
![]()
Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy
hi
i store the multicheckbox values as a sumofarray in database, i want to compare the values with original and set as checked , how do it can any one help me to solve the problem
for example
PHP Code:<input type="checkbox" value="1" name="val[]">
<input type="checkbox" value="2" name="val[]">
<input type="checkbox" value="4" name="val[]">
<input type="checkbox" value="8" name="val[]">
PHP Code:<?php
/*
Defaults
*/
$checkboxes = array(
1 => false,
2 => false,
3 => false,
4 => false,
5 => false
);
/*
Values from database
*/
$database = array(
2 => true,
4 => true,
);
foreach(array_replace($checkboxes, $database) as $value => $isChecked){
printf(
'<input type="checkbox" name="val[]" value="%s" %s />' . PHP_EOL,
$value,
$isChecked ? 'checked="checked"' : ''
);
}
/*
<input type="checkbox" name="val[]" value="1" />
<input type="checkbox" name="val[]" value="2" checked="checked" />
<input type="checkbox" name="val[]" value="3" />
<input type="checkbox" name="val[]" value="4" checked="checked" />
<input type="checkbox" name="val[]" value="5" />
*/
@AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.
i m storing checkbox array values as sum in database
if first and second checkbox check i m storing the values as sum of array
array_sum(checkbox array) in database
now values from database is 2+4 =6
how to decode and set check box as checked status
See my answer in your other thread.
http://www.sitepoint.com/forums/php-...ml#post4917965
![]()
@AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.
Bookmarks