1. Home
  2. Computing & Technology
  3. PHP / MySQL

PHP and Math

PHP allows you to preform numerous mathematical tasks. You can do anything from simple addition to complex geometry. You can also do things like round numbers, convert bases, or find the absolute value of numbers.

More PHP Math

PHP / MySQL Spotlight10

Skip over code using goto

Sunday April 24, 2011

Did you know that you can skip over chunks of PHP using goto?  Goto is not a function, but rather a control structure.  You can see an example of goto in action in this article.

A Unique ID

Sunday April 17, 2011

I'm sure it's happened to you before: you sign up for a site and they generate you a unique user ID to use. One way to do this in PHP is to use the uniqid () function. This with generate a 13 or 23 character unique ID, which you can then add a prefix to if you desire. Once you send this to the user, you can then encrypt it and store it in the database.

Manipulating Capitalization in Strings

Monday April 11, 2011

Did you know that you can change the capitalization of strings using PHP?  You can change the capitalization of stored or inputted text using a few PHP functions.  These can be used to make the string all capital letters, all lower case letters, capitalize the first letter of every word, or capitalize the first letter of every string!  [read how]

How to Generate a Unique ID

Sunday April 3, 2011

A unique site ID can be created in PHP using the uniqid () function. This function has two parameters we can set. The first is the prefix. This is what will be appended to the beginning of each ID. The second is more_entropy. If this is false or not specified it will return 13 characters, if it is true then 23 characters will be returned. [read more]

Discuss in the forum

  1. Home
  2. Computing & Technology
  3. PHP / MySQL

©2011 About.com. All rights reserved. 

A part of The New York Times Company.