use explode itself to see if it is explodable $a = explode(” “,”Where Am I?”); if(count($a)>1) { echo “explodable”; } else { echo “No use of exploding”; } or if(strpos($row[‘city’], ‘ ‘) !== false) { // explodable } else { // not explodable }
Category Archives: PHP
PHP add and remove Vat from Price
function vat_add($price, $vat) { $nett = $price; $gross = $nett * ($vat / 100) + $nett; return $gross; } function vat_remove($price, $vat) { $gross = $price; $nett = $gross-($gross * ($vat / 100)); return $nett; }
AngularJS-Twig conflict with double curly braces
solution 1 You can change the start and end interpolation tags using interpolateProvider service. One convenient place for this is at the module initialization time. angular.module(‘myApp’, []).config(function($interpolateProvider){ $interpolateProvider.startSymbol(‘{[{‘).endSymbol(‘}]}’); }); Solution 2 You can use too the attribute-based directive <p ng-bind=”yourText”></p> is the same as <p>{{yourText}}</p> Solution 3 Verbatim, is very elegant and readable for several …
Continue reading “AngularJS-Twig conflict with double curly braces”
Replace PHP short open tags with full form in all ‘.php’ files using one command
Nowdays, In the latest versions of web servers, The PHP short open tags are diabled by default, Although we can able to enable it in the ‘php.ini’ file, Some of the shared hosting servers may be diabled that systax and you have to migrate your code to the standard syntax…
install php spell check on linux
For php spell checking in php on centos install