title: PHP: get array value as in Python?
body: <p>In Python I can use "get" method to get value from an dictionary without error.</p>
  
  <pre><code>a = {1: "a", 2: "b"}
  a[3] # error
  a.get(3, "") # I got empty string.
  </code></pre>
  
  <p>So I search for a common/base function that do this:</p>
  
  <pre><code>function GetItem($Arr, $Key, $Default){
      $res = '';
      if (array_key_exists($Key, $Arr)) {
          $res = $Arr[$Key];
      } else {
          $res = $Default;
      }
      return $res;
  }
  </code></pre>
  
  <p>Have same function basicly in PHP as in Python?</p>
  
  <p>Thanks:
     dd</p>