How to speed up my site
Each and every single web site owner wants to see his/her website pages load faster than others but only some of them got it because its depend on server , network speed and mostly on programmer’s work strategy.An intelligent programmer always try to make site faster.Becasue when user surf a web site they want to run that faster and if site run slow than they switch to other site.The load time of websites is one of the most important factors affecting its usability; most Internet users will just skip a site altogether if it fails to load within a couple of seconds.
1. Optimize Images: always use Optimized images on a web page. Images represent the heavier load on virtually any website so make sure you are optimizing them. Alternatively you can also turn to an online image optimizer.When save image in an image editor try to save them with low resolution and save them using shift+ alt + ctrl +s for a web page.Even try to minimize image on a web page and make effect using css that will load the page faster.
Tags: Apache, browser, css, fast, faster, gif, http, HTTP Requests, Image Formats, images, Javascript, JPEG, loadtime, memory, Mod_deflate, mod_gzip, network, objects, ob_start, Optimize CSS, Php, server, speed, website, website speed optimization
Difference between == and === operator
Both == and === are Compraison operators.
== check for equality of values
=== check equality as well as type of the operands means they should be equal and of same type.
For ex. 1==true means result is ture (both are equal)
but 1===true means result is false (both are equal but not same type)
Tags: comprasion, operator
Difference between htmlentities( ) and htmlspecialchars( ) ?
Sep 18, 2009 Html
Both are predefined function of php.
htmlentities() — Convert all applicable characters to HTML entities.
<?php
$str = “A ‘quote’ is <b>bold</b>”;
// Outputs: A ‘quote’ is <b>bold</b>
echo htmlentities($str);
?>
and
htmlspecialchars() — Convert special characters to HTML entities.
<?php
$new = htmlspecialchars(”<a href=’test’>Test</a>”, ENT_QUOTES);
echo $new; // <a href='test'>Test</a>
?>
Special charachers are :
=> ‘&’ (ampersand)
=> ‘”‘ (double quote)
=> ”’ (single quote)
=> ‘<’ (less than)
=> ‘>’ (greater than)
