$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $fff);
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP Bot');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$json = curl_exec($ch);
curl_close($ch);
if ($json !== false) {
//$json = preg_replace("#(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|([\s\t]//.*)|(^//.*)#", '', $json);
setlocale(LC_ALL, 'ru_RU.utf8');
Header("Content-Type: text/html;charset=UTF-8");
$json = json_decode($json, true) ;
//print_r($json);
<?php
//print_r($_POST);
if (!empty($_POST[json_name])) { $json_data = $_POST['json_name'];$json = json_decode($json_data,true); $a = $json['name'];$b = $json['idtime'];
if ($a !== false) {
var data = data: {
name: '',
------------------
json_name="+data ;
var a = json_name={
name: ''+event.target.id+'',
time: '<?php echo''.$fulluri2.'' ; ?>',
c: ' собака <?php echo ''.$list.''; ?>'
};
var dAnimal = JSON.stringify(a);
$fff2 ='https://www.googleapis.com/youtube/v3/search'.$region.'&'.$vpoisk.'&key=///////////////'.$rating.'&type=video&'.$time.'&part=snippet&safeSearch=none'. $kolisestvo.'
';
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $fff2);
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP Bot');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
$json = curl_exec($ch);
curl_close($ch);
if ($json !== false) {
$json = preg_replace("#(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|([\s\t]//.*)|(^//.*)#", '', $json);
// setlocale(LC_ALL, 'ru_RU.utf8');
$json = json_decode($json, true) ;
// print_r($json);
if (isset($json['items']))
{
foreach($json['items'] as $items) {
$channelId =$items['snippet']['channelId'];
$publishedAt =$items['snippet']['publishedAt'];
$title =$items['snippet']['title'];
if (isset($items['snippet']['thumbnails']['default']['url']))
{ $thumbnails =$items['snippet']['thumbnails']['default']['url'];
if (isset($items['id']['videoId'])) {
$videoId =$items['id']['videoId'];
$json = preg_replace("#(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|([\s\t]//.*)|(^//.*)#", '', $json);