Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
zendframework1
library
Zend
Filter
Digits.php
Go to the documentation of this file.
1
<?php
2
27
#require_once 'Zend/Filter/Interface.php';
28
29
36
class
Zend_Filter_Digits
implements
Zend_Filter_Interface
37
{
43
protected
static
$_unicodeEnabled
;
44
52
public
function
__construct
()
53
{
54
if
(
null
=== self::$_unicodeEnabled) {
55
self::$_unicodeEnabled = (@preg_match(
'/\pL/u'
,
'a'
)) ?
true
:
false
;
56
}
57
}
58
67
public
function
filter
(
$value
)
68
{
69
if
(!self::$_unicodeEnabled) {
70
// POSIX named classes are not supported, use alternative 0-9 match
71
$pattern
=
'/[^0-9]/'
;
72
}
else
if
(extension_loaded(
'mbstring'
)) {
73
// Filter for the value with mbstring
74
$pattern
=
'/[^[:digit:]]/'
;
75
}
else
{
76
// Filter for the value without mbstring
77
$pattern
=
'/[\p{^N}]/'
;
78
}
79
80
return
preg_replace(
$pattern
,
''
, (
string
)
$value
);
81
}
82
}
Zend_Filter_Digits\$_unicodeEnabled
static $_unicodeEnabled
Definition:
Digits.php:43
$pattern
$pattern
Definition:
website.php:22
$value
$value
Definition:
gender.phtml:16
Zend_Filter_Digits\filter
filter($value)
Definition:
Digits.php:67
Zend_Filter_Interface
Definition:
Interface.php:30
Zend_Filter_Digits
Definition:
Digits.php:36
Zend_Filter_Digits\__construct
__construct()
Definition:
Digits.php:52