Learning Coding – Week 1 Progress

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!

I had planned on signing up for a TutsPlus premium membership this week, but 1) it’s already Tuesday, and 2) I’ve just found about two dozen more tutorials I’d like to check out first on javascript, php, and css.


Below I’ve pasted some code snippets that I found helpful as I was figuring out that issue.

Code Snippets

<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+ */
 word-wrap: break-word;
    <?php print_r($yourArray); ?>

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 .


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>