www.webdeveloper.com
Results 1 to 3 of 3

Thread: add element to multi dimensional array

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    faisalabad, punjab, pakistan
    Posts
    241

    add element to multi dimensional array

    hi,
    i want to add and element in Help array as topic6 => topic 6,

    how i can do that ?? thanks in advance

    PHP Code:
    Array
    (
        [
    Dashboard] => Array
            (
                [
    home] => Home
                
    [about] => About Us
            
    )

        [
    Help] => Array
            (
                [
    topic1] => Help Topic 1
                
    [topic2] => Help Topic 2
                
    [topic3] => Help Topic 3
                
    [topic4] => Help Topic 4
                
    [topic5] => Help Topic 5
            
    )

        [
    Location] => Array
            (
                [
    contact] => Contact Us
                
    [findus] => Find Us
                
    [map] => Google Map
            


  2. #2
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    PHP Code:
    $xyz['Help']['topic6'] = 'Help Topic 6'

  3. #3
    Join Date
    Sep 2013
    Posts
    221
    Try this:
    Go to the below link, it will surely clear your doubt and will help you to understand better.
    http://php.net/manual/en/function.array-push.php

    Hope this helps.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles