Calling a function using variable name in PHP Get link Facebook X Pinterest Email Other Apps July 15, 2019 <?phpfunction show_name(){ echo 'Rangan Roy';}$var = 'show_name';$var(); // output: Rangan Roy?> Get link Facebook X Pinterest Email Other Apps Comments
A variable variable in PHP July 15, 2019 <?php $varname = 'tireqty'; $$varname = 100; echo $tireqty; // output: 100 ?> Read more
Timestamps in PHP March 09, 2019 <?php echo date('h:i:s a', time() + 5 * 3600).'<br/>'; // added 5 hours to current time echo date('h:i:s a', strtotime('5 hours')).'<br/>'; // added 5 hours to current time $timestamp = mktime(0, 40, 30, 2, 11, 95); // made own time echo 'Time: '.date('h:i:sa', $timestamp).'<br/>'; // Time: 12:40:30am echo 'Date: '.date('d/m/Y', $timestamp).'<br/>'; // Date: 11/02/1995 $timestamp = mktime(12, 40, 30, 2, 11, 95); echo 'Time: '.date('h:i:sa', $timestamp).'<br/>'; // Time: 12:40:30pm $timestamp = mktime(13, 40, 30, 2, 11, 95); echo 'Time: '.date('h:i:sa', $timestamp).'<br/>'; // Time: 01:40:30pm ?> Read more
Comments
Post a Comment