Blog

PHP Functions

PHP Code for Replacing Characters in a String or Variable

str_replace(‘”‘, “”, $string); preg_replace(“//”, “”, $string); C-style quotes: preg_replace(“/\/\/.*?\n/”, “\n”, $string); CSS-style quotes: preg_replace(“/\/*.*?\*\//”, “”, $string); bash-style quotes: preg-replace(“/#.*?\n/”, “\n”, $string);

Read more
PHP Functions

Split PHP String into Multiple Variables Made Easy

Like a Glove….

Read more
PHP Functions

Adding or Subtracting Time to/from MYSQL Formatted Timestamp in PHP

Just replace “+1 day” with what ever you need to add. ex “+1 year, +1 day” etc. Have fun. $date = date(“Y-m-d”,strtotime(“+1 day”));

Read more
PHP Functions

Easy Way to Convert Month Number into Month Names with PHP

And here it is.

Read more

Software/Web Developer Contract Template

THIS AGREEMENT (“Agreement”) is entered into on __, between Smith (“Developer”), with its principal place of business located at XXXXXXX, Newton, MA, and ________ (“Client”), with its principal place of business located at ___________________________ and shall be effective as of ___ (the “Effective Date”). WHEREAS, Developer is engaged in the business of software development, WHEREAS, Client wishes to utilize the services of Developer in […]

Read more

How to embed a Flash/Swf File

Read more

Add Ftp Users and Change Home Directory

To add a user account, use the following syntax, and follow the prompts to give the account a password and identifiable characteristics such as a full name, phone number, etc. sudo adduser username To delete a user account and its primary group, use the following syntax: sudo deluser username Deleting an account does not remove […]

Read more
PHP Functions

Easily Run PHP Script As A Cron Job Linux

I’ve nicely written PHP script that I’d like to run as a cron job. I’m using CentOS 4.5 as server with Apache web server. How do I setup a PHP script as a cron job? You need to setup execute permission on a php script. You need to use chmod command to change file access […]

Read more
PHP Functions

How to get Longitude and Latitude from an Address with PHP. So Easy

Read more

Why does apt-get fail to resolve the mirror?

yes, the name server update does work and if it does work then you’ve probably updated your IP settings to be static and your server can no longer resolve URLs. Try the above and if it works reboot. if it fails after rebooting then do this: edit the template file for the resolv.conf. Ubuntu server […]

Read more