Skip to content

Commit

Permalink
正则匹配类
Browse files Browse the repository at this point in the history
  • Loading branch information
wuding committed Feb 21, 2019
1 parent b7750b1 commit ab0ab32
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/PCRE.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Func;

class PCRE
{
public function __construct()
{

}
}

function str_match($pattern, $subject, $value = null, $type = false)
{
$val = $value;
$match = preg_match($pattern, $subject);
if ($type) {
return $f = $match ? $val : $subject;
}
return $z = $match ? $subject : $val;
}

0 comments on commit ab0ab32

Please sign in to comment.