Category Archives: PHP

empty() function PHP

empty() function determines whether given variable is empty and also used for checking variable is set or not. Variable is said to empty if it is not set or value is false. empty values can be : 0 “” or “0” 0.0 (0 float value) FALSE empty array() NULL Reference : http://php.net/manual/en/function.empty.php

How to Translate Text to desired language ?

Just follow these steps and copy & paste the code you can translate text easily. Step 1 : Make a div with id (id is compulsory) Like <div id="content">Loading…</div><div id="content">Loading…</div> Step 2 : Paste the following code to head section under script tag of your webpage.   <script type="text/javascript"> google.load("language", "1");   function initialize() {… Read More »

How to Remove Characters Except Numbers from a String ?

Following Code will remove all character,special characters including space.   $givenNumber = "1245fdfd8454D FDFDF434 3$#$#%";   $testingNumber = preg_replace('[D]’, ”, $givenNumber);   echo $testingNumber;   Output is : 124584544343 $givenNumber = "1245fdfd8454D FDFDF434 3$#$#%"; $testingNumber = preg_replace(‘[D]’, ”, $givenNumber); echo $testingNumber; Output is : 124584544343