[ create a new paste ] login | about

Link: http://codepad.org/4FEdxqe3    [ raw code | output | fork ]

PHP, pasted on Apr 16:
<?php
$arr = array(
  "pērkons" => 1,
  "saule" => 1,
  "zeme" => 1,
  "zobens" => 1
);

echo isset($arr['saule'])? "ir" : "nav";
echo "\n";

echo isset($arr['koks'])? "ir" : "nav";
echo "\n";

echo isset($arr['zeme'])? "ir" : "nav";
echo "\n";

$arr['koks']=1;

echo isset($arr['koks'])? "ir" : "nav";
echo "\n";

foreach($arr as $key=>$val){
  echo $key." ";
}


Output:
1
2
3
4
5
ir
nav
ir
ir
pērkons saule zeme zobens koks 


Create a new paste based on this one


Comments: