#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,246
    Rep Power
    220

    Update arry issue


    How come I can't change the value of 'full_path'?

    PHP Code:
    print_r($this->upload->data());
    $this->upload->data()[0]['full_path']='new value';
    print_r($this->upload->data()); 
    Array
    (
    [file_name] => f5641fbbbd7b8403e69197ecd672ad0f.jpg
    [file_type] => image/jpeg
    [file_path] => /Applications/MAMPPRO/Sites/***/temp/
    [full_path] => /Applications/MAMPPRO/Sites/***/temp/f5641fbbbd7b8403e69197ecd672ad0f.jpg
    [raw_name] => f5641fbbbd7b8403e69197ecd672ad0f
    [orig_name] => 1.jpg
    [client_name] => 1.jpg
    [file_ext] => .jpg
    [file_size] => 313.25
    [is_image] => 1
    [image_width] => 2616
    [image_height] => 1176
    [image_type] => jpeg
    [image_size_str] => width="2616" height="1176"
    )
    Array
    (
    [file_name] => f5641fbbbd7b8403e69197ecd672ad0f.jpg
    [file_type] => image/jpeg
    [file_path] => /Applications/MAMPPRO/Sites/***/temp/
    [full_path] => /Applications/MAMPPRO/Sites/***/temp/f5641fbbbd7b8403e69197ecd672ad0f.jpg
    [raw_name] => f5641fbbbd7b8403e69197ecd672ad0f
    [orig_name] => 1.jpg
    [client_name] => 1.jpg
    [file_ext] => .jpg
    [file_size] => 313.25
    [is_image] => 1
    [image_width] => 2616
    [image_height] => 1176
    [image_type] => jpeg
    [image_size_str] => width="2616" height="1176"
  2. #2
  3. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,436
    Rep Power
    9645
    You can't assign to the return value of a function.

    Do the obvious thing without trying 2B clever.
    PHP Code:
    $data $this->upload->data());
    $data[0]['full_path'] = 'new value';
    print_r($data); 

IMN logo majestic logo threadwatch logo seochat tools logo