The vast majority of questions I receive boil down to How to Layout a Website!
While I’m not going to say it is easy to make a website. It takes time! However, I think anyone can learn to layout a website if they grasp some core concepts.
In my next series of videos I’m going to focus on everything you need to know to layout a website using just a text editor.
I previously covered this topic in a WordPress HTML Tutorial , but this time I’ll approach it in a more step-by-step manor.
In part 5 of my Web Design and Programming tutorial I will cover the following topics:
How to turn a string into an array
How to turn an array into a string
How to sort an array
How to pull data from a file and store it in an array
And, I’ll also go over a bunch of other functions specific to arrays. If you missed part 1 of this tutorial it is available here Web Design and Programming.
All of the code in this tutorial will follow the video. Use it in any way that you would like.
If you have any questions or comments leave them below and I’ll answer them.
<?php
# An array is just a big box containing many similar boxes
# This information is similar to each other
# All the the information or values have a coresponding key or label associated with it
# An array can contain any combination of numbers, strings or other arrays
# Create basic array with key value pairs
/* $myInfo = array(“Name” => “Derek”, “Street” => “123 Main St”, “City” => “Pittsburgh”);
# Get the value by calling for the key associated with it
echo “My name is “, $myInfo[“Name”], “<br /><br />”;
$moreInfo = array(“State” => “PA”, “Age” => 35);
# Merge 2 arrays into one
$myInfo = array_merge($myInfo, $moreInfo);
# Iterate through the array with the foreach looping device
foreach( $myInfo as $key => $value)
{
echo $key, ” “, $value, “<br />”;
}
echo “<br /><br />”;
# Search for a key in an array
if(array_key_exists(“Name”, $myInfo)) echo “The name stored is “, $myInfo[“Name”];
echo “<br /><br />”;
# Search for a value in an array
$citySearch = array_search(“Pittsburgh”, $myInfo);
echo “The key for the city is “, $citySearch;
echo “<br /><br />”;
print_r (array_keys($myInfo)); # Short cut to provide the arrays keys
echo “<br /><br />”;
print_r (array_values($myInfo)); # Short cut to provide the arrays keys & values
echo “<br /><br />”;
I’ve been getting request’s that I better organize my site. So, here is my whole site organized into nice little pieces.
You guys define what I write about. If there is something specific you’d like me to cover leave a comment below. Don’t think your limited to just topic’s that I’ve covered either. I’m open to research pretty much anything.