Posts

Showing posts from June, 2017

PHP: Loops

Sometimes when we're coding, we want to do something that would be very tedious. This is where loops come in. Loops repeat a series of instructions for you for a specified number of times.

Why it's So Hard to Redesign Cars

I shared fake news yesterday. There. I admit it. I shared the latest fan renderings of the upcoming Jeep Wrangler pickup, which were presented in such a way that made it sound like it was the official design released by Fiat Chrysler Automobiles, or FCA, Jeep's parent company. Like many times before it and many times after, this was just a couple renderings of what fans of the Wrangler believe the new small-pickup will look like. My shared content sparked a discussion among friends over two things. 1) Critique of the design and 2) Relevance of fan renderings. I'd like to discuss these two things.

PHP: Arrays

Back to more PHP, you may be wondering how PHP stores information. It can call or modify information in an SQL database, but we'll cover that later. So far, we know that we can save individual bits of information as variables. Let's look at Arrays. An Array is a list, and it allows you to save more than one bit of information within a single variable. Array Syntax A very simple array, could simply be a shopping list, like the example below. <?php       $SampleArray = array("Egg", "Tomato", "Beans");     ?>   An array starts with a variable, and then is followed by the =, just like we've done before. However, the array() portion of the statement is where we can put in multiple values. These could be strings, numbers, and/or previously declared variables. The information within the ellipses are separated by commas and each string is within double quotes, just like we've seen with past variable declarations or echo statements.

PHP: Flow Control

The phrase "Flow Control" might sound weird, as though we're talking about fluids or money. It sounds vague and almost clinical. While "Flow Control" might be something to think about for a variety of other topics, we're going to look at the flow control of data in PHP. As mentioned in the introductory post, lines of PHP code are referred to as statements. When we explored some of the syntax in the last post, the lines of code for declaring variables, performing mathematical operations, or echoing strings were all statements. Below, let's look at the statements we'd use to control the flow of information within a PHP script. Co mparisons Comparisons in PHP are done with Comparison Operators. I've listed the symbols below. > Greater than < Less than >= Greater than or equal to <= Less than or equal to == Equal to != Not equal to For example, below, we're going to see a PHP statement stating that 6 is less than

PHP: An Introduction

Have you had an idea for an application? Perhaps you have an idea for a web-app. Maybe you have a niche problem you'd like to solve, or maybe you just want to learn more about programming and software development. PHP is very capable and it's easy to get started. This is the first in a series of posts teaching PHP. I'll also have posts on SQL so you can work with information in databases and Git so you can use version control for your code. So, why PHP?