Binary Expressions

2006-6-7

Common Mistake - Echoing an Array

Filed under: — Adam @ 11:29 am

I’m sure most would agree when one does a programming mistake they are a lot of times trivial mistakes. However when one stares at the code for long periods of time we seem to go blind and then in the process of frustration loose all logically thinking as to what could be causing the problem. Here is one such problem with arrays.

  • Problem
  • The value of the Array is not rendering. Instead you see array[0].
  • Solution
  • Remove your single or double quotes around the variable representing the array. When one places single or double quotes around the array you are causing it to be treated as literal.

    Comments are closed.

    Take back your mailbox - CAUCE.org

    Powered By Wordpress PHP: Hypertext Preprocessor MySQL Powered Download Juice, the cross-platform podcast receiver
    Proud To Be Canadian Get Firefox Valid XHTML Valid CSS
    <NO>OOXML Logo


    24 queries. 0.230 seconds.
    Copyright © 2004 - 2005 by Adam Douglas