title: Error Array to String JPG Error
body: <p>I want to fetch a string to find the URLs, store them in an array and use them to build an custome output. The problem is that I get an error that I have a string to array conversion.</p>
  
  <blockquote>
    <p>NOTICE Array to string conversion on line number 21 JPEG (Array)</p>
  </blockquote>
  
  <p>Can some help me, is there another way to get the URL which is stored in the array?</p>
  
  <pre><code>  function getURLSfromStringToImages($string) {
       $regex = '/https?\:\/\/[^" ]+/i';
       preg_match_all($regex, $string, $matches);
        //($matches[0]);
  
       $tmp      = '';
          $tmpArray = $matches;
  
      if ( is_array( $tmpArray ) ) {
  
          $size  = count( $tmpArray ); //array size by using count() function
          $index = 0;
  
          while ( $index &lt; $size ) {
              $tmp .= '&lt;anhang location="REMOTE" gruppe="BILD"&gt;' . "\n"
                      . '&lt;format&gt;JPEG&lt;/format&gt;' . "\n"
                      . '&lt;daten&gt;' . "\n"
                      . '&lt;pfad&gt;' .  "($tmpArray[$index])" . '&lt;/pfad&gt;' . "\n"
                      . '&lt;/daten&gt;' . "\n"
                      . '&lt;/anhang&gt;' . "\n \n";
              $index ++;
          }
  
  
      } 
  
      echo $tmp;
  
  }
  
  $urls = getURLSfromStringToImages('a:3:{i:0;a:9:{s:22:"real_estate_floor_name";s:7:"Karnten";s:23:"real_estate_floor_price";s:0:"";s:31:"real_estate_floor_price_postfix";s:0:"";s:22:"real_estate_floor_size";s:0:"";s:30:"real_estate_floor_size_postfix";s:0:"";s:26:"real_estate_floor_bedrooms";s:0:"";s:27:"real_estate_floor_bathrooms";s:0:"";s:29:"real_estate_floor_description";s:0:"";s:23:"real_estate_floor_image";a:2:{s:2:"id";s:4:"4243";s:3:"url";s:70:"https://www.immo-verteiler.de/wp-content/uploads/2018/06/grundriss.jpg";}}i:1;a:9:{s:22:"real_estate_floor_name";s:6:"sterer";s:23:"real_estate_floor_price";s:0:"";s:31:"real_estate_floor_price_postfix";s:0:"";s:22:"real_estate_floor_size";s:0:"";s:30:"real_estate_floor_size_postfix";s:0:"";s:26:"real_estate_floor_bedrooms";s:0:"";s:27:"real_estate_floor_bathrooms";s:0:"";s:29:"real_estate_floor_description";s:0:"";s:23:"real_estate_floor_image";a:2:{s:2:"id";s:4:"4211";s:3:"url";s:76:"https://www.immo-verteiler.de/wp-content/uploads/2018/06/Hotel-Goestling.jpg";}}i:2;a:9:{s:22:"real_estate_floor_name";s:13:"lkjölkjölkj";s:23:"real_estate_floor_price";s:0:"";s:31:"real_estate_floor_price_postfix";s:0:"";s:22:"real_estate_floor_size";s:0:"";s:30:"real_estate_floor_size_postfix";s:0:"";s:26:"real_estate_floor_bedrooms";s:0:"";s:27:"real_estate_floor_bathrooms";s:0:"";s:29:"real_estate_floor_description";s:0:"";s:23:"real_estate_floor_image";a:2:{s:2:"id";s:4:"3907";s:3:"url";s:66:"https://www.immo-verteiler.de/wp-content/uploads/2018/05/klein.jpg";}}}');
  
  print_r($urls);
  </code></pre>