Corona SDK and other Game Development Tutorials
@gamebuilding

Archive for the Some PHP Category

Sending Emails with Attachments using PHP

Sending Emails with Attachments using PHP

Recently, I’ve had to set up a cron job send out emails, but the catch was the email needed to have an attachment. There are several ways to send out an email with an attachment using php, but the easiest way I found (so far) was using

Read more

Unzipping files with php

Unzipping files with php

Recently, I’ve had to unzip a file using php. The code below takes advantage of the ZipArchive class and will extract a zipped file to the current directory. Here’s how. $zip = new ZipArchive; $res = $zip->open($filename); if ($res === TRUE) { $zip->extractTo(‘./’); $zip->close(); echo ‘Unzip was

Read more

Using Regular Expressions

Using Regular Expressions

Below are some samples of how to use regular expressions with php. ¬†Finding a Number in a String Here’s how you would find a number in a string with php, but will stop on the first match. Of course, make sure to wrap your code with the

Read more

Regular Expressions

Regular Expressions

If you’re like me, then Regular Expressions can look like ancient greek. So, I’ve put together a list of commonly used phrases with a short explanation of how the expression can be used. Regular Expressions -> Regular Expression Definition An example of the regular expression. . ->

Read more