- 01
 - 02
 - 03
 - 04
 - 05
 - 06
 - 07
 - 08
 - 09
 - 10
 - 11
 - 12
 - 13
 - 14
 - 15
 - 16
 - 17
 - 18
 - 19
 - 20
 - 21
 - 22
 
                        <? 
$price_id = $_GET['price_id']; 
$price_id=(int)$price_id; 
$output = array(); 
$data = !empty($_COOKIE['products']) ? unserialize($_COOKIE['products']) : array();?> 
<? if ($price_id):?> 
<? $data[0]="0";?> 
<? $key=array_search($price_id,$data);?> 
<? if($key!== false):?> 
<? unset($data[$key]); ?> 
<? $data[0]="добавить в закладки";?> 
<?else:?> 
<? $data[]=$price_id; 
$data[0]="удалить закладку";?> 
<?endif;?> 
<?endif;?> 
<? 
$b="texttext"; 
setcookie('products', serialize($data), time() + 172800, "/", '', false, true); 
//print $b; 
//$output['total_products_count'] = $b; 
echo json_encode($b);?>
                                 
        
Ваш К.О
php как php