pushin' arrays

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carllucas
    New Member
    • Oct 2006
    • 35

    pushin' arrays

    Can anyone explain this error.

    My code:
    Code:
    $myArray = array();
    array_push($myArray, $path);
    The error (warning) I continue to get is:
    Warning: array_push(): First argument should be an array

    Any help much appriciated. Thanks :)
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    You must have done something else because, when tested, it works as it should. Are you sure that what you show is the exact sequence of statements and that you have not modified the type of $myArray some place else in your code?

    Ronald :cool:

    Comment

    • carllucas
      New Member
      • Oct 2006
      • 35

      #3
      Originally posted by ronverdonk
      You must have done something else because, when tested, it works as it should. Are you sure that what you show is the exact sequence of statements and that you have not modified the type of $myArray some place else in your code?

      Ronald :cool:
      Yup I did just that, cos the above worked. Miss-named a variable.

      *shaking my head in shame*

      Comment

      Working...