title: Jquery : JSON changes string of path
body: <p>I am trying to get list of image path from my db and with help of Jquery and Json triying to add to my site. But I don<code>t know why after  encoding my string  using</code>json_encode` in php it changes it path and shows me like  </p>
  
  <pre><code>[{"0":"user\/photogallery\/images\/members\/2\/2_1.jpg","src":"user\/photogallery\/images\/members\/2\/2_1.jpg"},{"0":"user\/photogallery\/images\/members\/2\/2_2.jpg","src":"user\/photogallery\/images\/members\/2\/2_2.jpg"}]
  </code></pre>
  
  <p>I need only <code>user/photogallery/images/members/2/2_2.jpg</code> part to create new <code>&lt;img src ="user/photogallery/images/members/2/2_2.jpg " /&gt;</code> component.</p>
  
  <p>Here my php code and script  </p>
  
  <pre><code>$member_id  = $GET['member_id'];
  $files      = find_all_photos($member_id);
  
  $encoded    = json_encode($files);
  echo $encoded;
  unset($encoded);
  
   function find_all_photos($id)
      {
        db_connect();
  
      $query = sprintf("SELECT src FROM photo_album_list WHERE user_id = '%s'", 
                             mysql_real_escape_string($id)); 
  
          $result = mysql_query($query);
  
          $result = db_result_to_array($result);
  
          return $result;
      }
  
  
      function db_result_to_array($result)
      {
          $res_array = array();
  
      for ($count=0;  $row = mysql_fetch_array($result); $count++)
      {
        $res_array[$count] = $row;
      }
  
          return $res_array;
  
      }
  </code></pre>
  
  <p>And script </p>
  
  <pre><code>$.get('photostack.php', {member_id:2} , function(data) {
                          console.log(data);
                          var items_count = data.length;
                          for(var i = 0; i &lt; items_count; ++i){
                              var item_source = data[i];
                              var cnt         = 0;
                              $('&lt;img /&gt;').load(function(){
                                  var $image = $(this);
                                  ++cnt;
                                  resizeCenterImage($image);
                                  $ps_container.append($image);
                                  var r       = Math.floor(Math.random()*41)-20;
                                  if(cnt &lt; items_count){
                                      $image.css({
                                          '-moz-transform'    :'rotate('+r+'deg)',
                                          '-webkit-transform' :'rotate('+r+'deg)',
                                          'transform'         :'rotate('+r+'deg)'
                                      });
                                  }
                                  if(cnt == items_count){
                                      $loading.remove();
                                      $ps_container.show();
                                      $ps_close.show();
                                      $ps_overlay.show();
                                  }
                              }).attr('src',item_source);
                          }
                      },'json');
  </code></pre>