PluginProbe
Welcart e-Commerce / 1.3.9
Welcart e-Commerce v1.3.9
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
usc-e-shop / classes / utilities.class.php

utilities.class.php in Welcart e-Commerce 1.3.9, at classes/utilities.class.php

35 lines 660 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 class WCUtils
3 {
4 function is_blank($val, $strict=false){
5
6 if ( !is_scalar($val) && NULL != $val ){
7 trigger_error("Value is not a scalar", E_USER_NOTICE);
8 return true;
9 }
10
11 if($strict)
12 $val = preg_replace("/ /", "", $val);
13
14 $val = trim($val);
15 if ( strlen($val) > 0 )
16 return false;
17 else
18 return true;
19 }
20
21 function is_zero($val){
22
23 if ( !is_scalar($val) && NULL != $val ){
24 trigger_error("Value is not a scalar", E_USER_NOTICE);
25 return false;
26 }
27
28 $val = trim($val);
29 if( !WCUtils::is_blank($val) && is_numeric($val) && 1 === strlen($val) && 0 === (int)$val )
30 return true;
31 else
32 return false;
33 }
34 }
35 ?>