How to set each assoc array value to empty??

Discussion in 'PHP' started by 123GoToAndPlay, Feb 19, 2010.

  1. #1
    How do i set each of this value to empty

    
    $data['profile_data']->fname='';
    $data['profile_data']->lname='';
    $data['profile_data']->city='';
    $data['profile_data']->number='';
    $data['profile_data']->car='';
    etc
    
    PHP:
     
    123GoToAndPlay, Feb 19, 2010 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    What do you get if you run:

    print_r($data['profile_data']);

    I'm not quite clear on the structure of your array.
     
    jestep, Feb 19, 2010 IP
  3. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #3
    Im not familiar with your array structure, as jestep suggested , reply with what the output is...

    Also if you wanted to delete an array element you could do:

    unset($array[$key]);
    PHP:
     
    danx10, Feb 19, 2010 IP