H
H
Hannskod2018-02-14 18:51:14
PHP
Hannskod, 2018-02-14 18:51:14

How to insert an array inside an element?

$diriction_mage = array();

while($xml_currency_row = mysql_fetch_array($xml_currency)){
$give = mysql_fetch_array(mysql_query("SELECT * FROM `currency` WHERE `id` = '".$xml_currency_row['give']."'"));
$get = mysql_fetch_array(mysql_query("SELECT * FROM `currency` WHERE `id` = '".$xml_currency_row['get']."'"));
$reserve = mysql_fetch_array(mysql_query("SELECT * FROM `currency` WHERE `id` = '".$xml_currency_row['get']."'"));
$direction  = array($give['name_xml'] =>  array('to' => array($get['name_xml'] => array('in' => intval ($xml_currency_row['give_course']), 'amount' => intval ($reserve['reserve']), 'in_min_amount' => intval($xml_currency_row['min_amount']), in_fee =>  array('%',2 )))));
array_push($diriction_mage,$direction);
}
$json =  array('exchanges' => array('from' => $diriction_mage) );
echo json

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question