To format a float value as a percentage in PHP:
$formatted = sprintf( '%.2f', $value * 100 );
To format a float value as a percentage in PHP:
$formatted = sprintf( '%.2f', $value * 100 );
I was interested to know if using prepared statements was a waste of time if the statement was only going to be used once. I found Are Prepared Statements a waste for normal queries? (PHP) on StackOverflow and basically came away with the understanding that it’s a pretty low overhead and it’s good for security so you might as well use prepared statements all the time.
Found a great article today! PHP Best Practices.
I’m trying to make my mind up about whether I should be using mysqli or PDO for a project I’m just starting and I’ve found a few relevant articles:
And based on all of that I think I’ve decided to use PDO.
Found an article tonight: Why you Should be using PHP’s PDO for Database Access. Skimmed it. Plan to read the whole thing later.
I learned about the PHP parse_url function today. I’ve wasted a lot of time not knowing about that!
Learned about the Portable PHP password hashing framework today.
Read about the PHP Magic Methods today.
Read a little from the Open Web Application Security Project today.
Read an article about Form Validation with PHP today.