json_encode($a, JSON_PRETTY_PRINT);
$main_array = array('movie' => $new,);
foreach($main_array as $brand => $massiv)
{
foreach($massiv as $inner_key => $value)
{
if (is_array($value)) {
foreach($value as $key => $val) {
echo "[$brand][$inner_key][$key] = $val
";
}
}
echo "[$brand][$inner_key] = $value
";
}
}
{
"response":{
"linkId":552,
"linkCode":"1",
"linkShort":"http:\/\/r.vlad805.ru\/1",
"date":1390076213,
"used":{
"count":11,
"last":1427203341
},
"ownerId":0,
"canDelete":false,
"linkOriginal":"http:\/\/vlad805.ru\/sites\/xmm"
}
}
$api = json_decode($api, true);
$linkOriginal = $api['response']['linkOriginal'];
include 'nokogiri.php';
$html = file_get_contents('http://www.sravni.ru/kredity/');
$saw = new nokogiri($html);
$kred = $saw->get('div[class=results__item__info__text]')->toArray();
var_dump($kred);
// Подключаемся.
mysql_connect("$address", "$user", "$password");
mysql_select_db("$base_mysql");
// Цикл со вставкой.
while (odbc_fetch_row($run_lo)) {
$id=odbc_result($run_lo,"id");
......
$query = "INSERT IGNORE into $table(id, ... )
VALUES('$id', .....)";
$query2 = iconv("", "UTF-8", "$query");
mysql_query($query2);
}
// Отключаемся.
mysql_close();