json_encode($text);
$file = file_gets_contents('http://domain/file.txt');
$file = json_decode($file);
echo $file['metrika'];
function get_idparentcat($cat_parent){
if( $cat_parent == 0 )
{
echo $cat->term_id;
}
else
{
echo $cat_parent;
}
}
get_idparentcat($cat_parent);
function get_idparentcat($cat_parent){
echo !$cat_parent ? $cat->term_id : $cat_parent;
}