title: make variables available outside function in PHP?
body: <p>I have this function which declares variables:</p>
  
  <pre><code>function imageSize($name, $nr, $category){
      $path = 'ad_images/'.$category.'/'.$name.'.jpg';
      $path_thumb = 'ad_images/'.$category.'/thumbs/'.$name.'.jpg';
      list($width, $height) = getimagesize($path);
      list($thumb_width, $thumb_height) = getimagesize($path_thumb);
          ${'thumb_image_' . $nr . '_width'} = $thumb_width;
          ${'thumb_image_' . $nr . '_height'} = $thumb_height;
          ${'image_' . $nr . '_width'} = $width;
          ${'image_' . $nr . '_height'} = $height;
  }
  </code></pre>
  
  <p>When I echo this:</p>
  
  <pre><code>   echo $image_1_width
  </code></pre>
  
  <p>It works fine, but if I do it OUTSIDE the function it wont recognize the variable, how can I make them 'global' somehow?</p>
  
  <p>Thanks</p>