It generate a generates a backtrace and displays data from the code that led up to the debug_backtrace() function.
Example
<?php
echo “<pre>”;
function back($arg1, $arg2) {
print_r(debug_backtrace());
}
back(“test1”, “test2”);
?>
The possible elements that can be returned are given below
function,line,file,class,object,type,Returns: “->” ,Returns: “::” ,Returns nothing,args
Output
Array
(
[0] => Array
(
[file] => /var/www/test/index.php
[line] => 6
[function] => back
[args] => Array
(
[0] => Peter
[1] => Griffin
)
)
)
It convert Unix timestamp to Julian Day
Example
<?php
echo unixtojd();
?>
Output
2456045
It converts a Julian Calendar date to Julian Day Count
Example
<?php
$jdate = juliantojd(8,4,1976);
echo $jdate . “<br />”;
$julian = jdtojulian($jdate);
echo $julian;
?>
Output
2443008
8/4/1976
It converts a date in the Jewish Calendar to Julian Day Count
Example
<?php
echo jewishtojd(3,3,5762);
?>
Output
2452232
It convert Julian Day to Unix timestamp
Example
<?php
$jdate = gregoriantojd(10,3,1970);
echo jdtounix($jdate);
?>
Output
23760000
It converts a Julian Day Count to a Julian Calendar Date
Example
<?php
$date = juliantojd(9,2,1977);
echo $date . “<br />”;
$julian = jdtojulian($date);
echo $julian;
?>
Output
2443402
9/2/1977
It converts a Julian day count to a Jewish calendar date
Example
<?php
echo jdtojewish(gregoriantojd(9,7,2000)) . “<br />”;
echo jdtojewish(gregoriantojd(9,7,2000),true);
?>
Output
13/7/5760
æ àìåì äúùñ
It converts Julian Day Count to Gregorian date
Example
<?php
$date = gregoriantojd(9,4,1976);
echo $date . “<br />”;
$gregorian = jdtogregorian($date);
echo $gregorian;
?>
Output
2443026
9/4/1976
It converts a Julian Day Count to the French Republican Calendar
Example
<?php
echo jdtofrench(2380644);
?>
Output
2/27/14
It returns a month name
Example
<?php
echo jdmonthname (cal_to_jd(CAL_GREGORIAN, date(“m”),date(“d”), date(“Y”)) , 1 );
?>
Output
April
Zend | Magento Certified PHP | eCommerce Architect