Category Archives: web development
PHP Find end of the month/last day of month
<?php echo date(“t-m-Y”); ?> The ‘t’ option of date returns the number of days in the month.
HTTP Compression
Test if a site has compression enabled: http://www.whatsmyip.org/http-compression-test/ Enable compression by adding the following line to .htaccess: AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
Responsive Notes
Twitter Bootstrap – responsive framework.
Mobile web dev
Viewports: CSS: Place before any media queries. @viewport { width: 480px; zoom: 1; } Meta tag (better support): <meta name=”viewport” content=”width=320″> <meta name=”viewport” content=”width=device-width”> <meta name=”viewport” content=”width=320,initial-scale=1″> // Set zoom to full size <meta name=”viewport” content=”initial-scale=1″>
iPhone turn off auto text resize (html/css)
To stop an iPhone from automatically resizing text on a webpage use: html { -webkit-text-size-adjust: none; }
PHP Regular Expressions
Notes: A regular expression is enclosed between two forward slashes “//“. Hash signs # or tildes ~ can also be used (these characters are called delimiters). eg. $exp = “/php/“; – search for the occurence of string ‘php’ Special/meta-characters: * Match … Continue reading
Google translate Firefox problem (not working on Apple Mac)
If the Google Translate drop down menu of languages does not open, or appears empty when the Google Translate tool is clicked in Firefox, the problem is usually caused by an issue with the Flash plugin, or the Flash plugin … Continue reading