Here’s a very useful function to generate a random string in php. I use this function quite often especially while working in core php projects.
Tag: php tips & tricks
How to debug a php application in production/live mode
How to debug a live website built in php? Here’s a basic, simple and custom method i usually use to debug live or production web applications (web sites). First of all i place the following lines of code in a…
Re-sizing image by width using php
A simple yet very useful function to re-size image by maximum width while keeping width and height in proportion. You just need to pass the maximum width allowed to this function and this function will return you an array containing…
Validating php multiple-value checkbox form element with javascript
In php a multiple-value form element such as checkbox is named suffixed with a set of square brackets. For example, My commonly used colors are: <form action=”index.php” name=”myform” method=”post” onsubmit=”return validate_form();”> <input type=”checkbox” name=”colors[]” value=”red” /> <input type=”checkbox” name=”colors[]” value=”green”…
Changing “Remember Me” text string in user box in Joomla 1.5
I wanted to change “Remember Me” text in the user login box in Joomla 1.5 to just “Remember” so that it should fit with the login button to the right of it while keeping them in same row.
Better way to write php code – part 2
With the help of an example i would explain a very common but erroneous approach new php developers seem to follow (i have seen some ‘old’ ones repeating the same error though). Here it is,
Better way to write php code – part 1
A few tips on writing php code that can save a php developer a lot of future troubles and “huffs and puffs” occurring due to different php compiler settings, changing of hosting environment etc. Here is first one.
Convert month name to month number in php
While working with a CJ run reports script i needed to convert “month name” into “month number” so i could store it in the database in date format. After doing some cleaning stuff i was ending with the month name,…