Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Warning: Cannot use a scalar value as an array

  1. #11
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    echo "<a href='$path/$folder/$doc'>".$data['doc']."</a></br>";
    }
    echo "<br>";

    Hope that's what you want...
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  2. #12
    Join Date
    Jun 2006
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thats it.
    Thank you for your assistance.

  3. #13
    Join Date
    Feb 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Declare the array. The error gets removed once you declare the array. In the following example we declare field as an array before declaring the array.
    <?php
    $field = array();
    $field[0]="monkey";
    $field[1]="donkey";
    $field[2]="hockey";
    $hockey = 173;
    print "My " . $field[0] . " is " . ${$field[2]} . " years old";
    ?>

Bookmarks

Posting Permissions

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