PHP Quick Script: Extract a link from a string
Have you ever needed to extract a link from a variable? Well with this little script it’s easy and you don’t have to learn regular expressions because it’s already included.

Have you ever needed to extract a link from a variable? Well with this little script it’s easy and you don’t have to learn regular expressions because it’s already included.

PHP has it’s own function to convert newline characters to xhtml break tags, however more often than not it didn’t work for me at all so I decided to use the strtr() function instead of the default PHP function.

Wouldn’t it be nice to never have to change your copyright year again. I was growing tired of changing my copyright year every year on each and every website, granted, it wasn’t that much work because the footer was usually included into the page, but still, with this tiny time [...]

Sometimes in PHP you’ll want or need to remove all the tags from a string, like the content coming in from a form field. PHP has it’s own function to strip_tags(), but what about the content in between the tags? This small function removes all tags and the content in [...]

Sometimes you’re going to need to store several values that you must keep separate from each other, for this we use arrays. Arrays are a little more complicated than what you’ve learned so far but well worth the time spent learning it.

Sometimes you’re going to need a place to store data that may not be changed by your application but can be accessed at any time you need that data. In this tutorial we’ll be looking at the next datatype, constants.

In this tutorial we’ll look at what a variable is, how to define and call a variable, some rules about writing variables and some basic features of variables.

Before we can start writing scripts, we must take a look at some of the datatypes. In this tutorial we’ll be looking at 4 scalar datatypes namely integers, booleans, floats and strings.

In PHP you’re going to need to output data to the browser, very often in fact. In this tutorial we’ll look at a few ways data can be sent to the browser to display.

In this tutorial we’ll take a look at the .php extension, some syntax (the opening and closing tags) and the importance of clean code and comments.