Arrays created in function test().
Then I would like print their on page test.php.
My code down:
conf.php
function test(){
$str= array(
'items' => array(
0 => array(
'title' => 'Title',
'category' => 'Category name',
),
1 => array(
'title' => 'Title',
'category' => 'Category name',
),
),
'details' => array(
'firstname' => 'firstname',
'lastname' => 'lastname',
),
'Id' => $Id,
'OrderId' => 'fsdfsfdsrew'
);
$json = json_encode($str);
$base64 = base64_encode($json);
$sig = signMessage($base64, $secretPhrase);
}
test.php
require_once("conf.php");
test();
print_r($str);
print_r($json);
print_r($base64);
print_r($sig);
Tell me please why code not worked?
Tell me please why weren't printed $str
, $json
, $base64
, and $sig
?
How do it?
Preferably without global parameters.