Skip to content

Megabyte

Web Development

  • About
  • Community

Megan 🐹 is a web developer specializing in WordPress. She is a Senior Developer at Blackbird Digital, an award-winning web agency. Neopets first introduced her to coding.

Check out Blackbird’s podcast, In The Loop!

She also enjoys competitive swimming, reading, and taking care of her pets, Sammy (calico cat) and Artie (bearded dragon).

Search Posts

Categories

Tag: PHP Function

Changing From mysql_ Functions to mysqli_

Posted May 13, 2016January 29, 2018

Here are the similarities and differences I noticed when switching from the mysql_ prefixed functions to the mysqli_ functions in PHP. Creating a Connection Creating and closing a connection are exactly the same using mysqli_: // Creating a Connection with mysql_connect() $conn = mysql_connect($servername, $username, $password); // Do stuff with […]

Category: PHPTags: Database Function Friday PHP Function

Increment Hex Values in PHP

Posted May 8, 2016January 29, 2018

Hex values aren’t just for colors! I recently had to generate a list of values from 00-ff and came up with this little snippet. Here’s how to increment hex values in PHP: For Reference: Hex Values Use (line 8) 0-f $x < 16 00-ff $x < 256 000-fff $x < […]

Category: PHPTags: Database PHP Function Snippet Sunday

Using date() and strtotime() to Set a Delivery or Shipping Date

Posted April 29, 2016January 29, 2018

Scenario: Let’s say your business ships products out every Monday, but the cut off date for ordering for the next delivery date is Thursday. This snippet checks the day of the week with date(‘w’). (It can also be accomplished by using l, D, or N.) Then, if it’s past a […]

Category: PHPTags: Function Friday PHP Function

PHP Function money_format()

Posted November 27, 2015April 11, 2018

I hope everyone had a great Thanksgiving! 🙂 I was inspired for this week’s Function Friday when I was working with Stripe API (using PHP). I was developing a webhook for when a charge fails that would send an email to various departments at my company. We needed the email […]

Category: PHPTags: Function Friday money_format() PHP Function

PHP Function str_replace()

Magnifying Glass Photo by Angelo_Giordano on Pixabay
Posted November 20, 2015April 11, 2018

Welcome to the inaugural Function Friday post! I created Function Friday as a way to both share my PHP and WordPress knowledge with others, and force myself to continue to learn on a schedule. After graduating with my Bachelors of Science in Technology degree in 2014, I realized I crave […]

Category: PHPTags: Function Friday PHP Function str_replace()
Links: Twitter WordPress.org WordPress Slack GitHub LinkedIn
Content Disclaimer