So I blew through the PHP Videos on the ThemeForest blog. I had some experience with PHP already so the videos really helped fill in some of the blanks and gave me a better understanding. Because the future TutsPlus videos that I plan on going through also come from a beginners perspective, I thought it wise just to blow through these videos rather than to play with the numerous examples myself. I’ll get plenty of practice later.
My buddy Shane turned me onto Titanium which makes coding life much easier than using my traditional FileZilla / Notepad++ combo for editing files on my servers. He also showed me the print_r command which is amazing for figuring out what is going on in your php arrays and using it eventually led to helping to solve the biggest coding challenge I’ve faced so far as I tried to build a new feature into ConnectOrange. As a side note, there is almost no better feeling than finally figuring out some coding issue that’s been eluding you for hours or even days at a time. It’s euphoria!
Below I’ve pasted some code snippets that I found helpful as I was figuring out that issue.
<pre style=" white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ background:#ffffff; word-wrap: break-word; "> <?php print_r($yourArray); ?> </pre>
This code will not only display your array, it will do so in a way that is nice and neat. The CSS there is to wrap the long lines of the output which would otherwise be cut off because of the <pre> tags.
I got the CSS from CSS Tricks .