I am viewing a php code that generate pdf on browser, code is working perfectly but I can't able to understand the meaning behind the following statement...
$page_format = array(
'MediaBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 210),
'Dur' => 3,
'trans' => array(
'D' => 1.5,
'S' => 'Split',
'Dm' => 'V',
'M' => 'O'
),
'Rotate' => 0,
'PZ' => 1,
);
$pdf->AddPage('P', $page_format, false, false);
If any one know about it, kindly help me out.
This creates an associative array whose first key is the single-quoted literal string 'MediaBox'
whose value is an associative array whose first key is the single-quoted literal string 'llx'
whose value is the decimal integer literal 0
, whose second key is the single-quoted literal string 'lly'
whose value is the decimal integer literal 0
, whose third key is the single-quoted literal string 'urx'
whose value is the decimal integer literal 210
, and whose fourth key is the single-quoted literal string 'ury'
whose value is the decimal integer literal 210
.
The second key of the outer associative array is the single-quoted literal string 'Dur'
which is associated with the decimal integer literal 3
, the third key is the single-quoted literal string 'trans'
which is associated with an associative array whose first key is the single-quoted literal string 'D'
which is associated with the decimal floating point number literal 1.5
, the second is the single-quoted literal string 'S'
which is associated with the single-quoted literal string 'Split'
, the third key is the single-quoted literal string Dm
which is associated with the single-quoted literal string 'V'
, the fourth key is the single-quoted literal string 'M'
which is associated with the single-quoted literal string 'O'
.
The fourth key of the outer array is the single-quoted literal string 'Rotate'
which is associated with the decimal integer literal 0
, and the fifth key is the single-quoted literal string 'PZ'
which is associated with the decimal integer literal 1
. This associative array is then bound to a variable called $page_format
.
The last line dereferences a variable called $pdf
and calls the AddPage
method of the object whose reference is stored in that variable, passing the single-quoted literal string 'P'
as the first argument, the associative array whose reference is stored in the $page_format
variable as the second argument, the boolean literal false
as the third argument, and the boolean literal false
as the fourth argument.