定制 joungkyun/ereg-extension-wrapper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

joungkyun/ereg-extension-wrapper

最新稳定版本:1.0.2

Composer 安装命令:

composer require joungkyun/ereg-extension-wrapper

包简介

pure PHP EREG extension wrapper

README 文档

README

GitHub license

The ereg-wrapper api support ereg extension api, and was designed to work best as with ereg extension. If you have PHP7 environment and must need removed ereg extension api, this is good choise.

This APIs have been implemented using PHP PCRE (Perl compatible regular expression, preg_*) internally.

License

BSD 2-clause

Requirements

  1. PHP 7.0.0 and after

SYNOPSIS

ereg : http://php.net/manual/en/function.ereg.php

int ereg ( string $pattern , string $string [, array &$regs ] )

eregi : http://php.net/manual/en/function.eregi.php

int eregi ( string $pattern , string $string [, array &$regs ] )

ereg_replace : http://php.net/manual/en/function.ereg-replace.php

string ereg_replace ( string $pattern , string $replacement , string $string )

eregi_replace : http://php.net/manual/en/function.eregi-replace.php

string eregi_replace ( string $pattern , string $replacement , string $string )

split : http://php.net/manual/en/function.split.php

array split ( string $pattern , string $string [, int $limit = -1 ] )

spliti : http://php.net/manual/en/function.spliti.php

array spliti ( string $pattern , string $string [, int $limit = -1 ] )

sql_regcase : http://php.net/manual/en/function.sql-regcase.php

string sql_regcase ( string $string )

Example

<?php
# even if loaded ereg extension, well done.
require_once 'ereg-wrapper.php';

if ( ! ereg ('a', 'aaa') )
    echo 'not ';
echo "matched\n";

if ( ! eregi ('A', 'aaa') )
    echo 'not ';
echo "matched\n";
?>

Composer

first, make composer.json as follow:

{
    "require": {
        "joungkyun/ereg-extension-wrapper": "1.0.*"
    }
}

and, install ereg-extension-wrapper

[user@host project]$ php composer.phpt install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing joungkyun/ereg-extension-wrapper (1.0.1): Downloading (100%)
Writing lock file
Generating autoload files
[user@host project]$

and, write code as follow:

<?php
require_once 'vendor/autoload.php';

echo 'eregi_replace is supported ';
if ( function_exists('eregi_replace') )
    echo 'YES';
else
    echo 'NO';

echo "\n";
?>

Credits

JoungKyun.Kim

统计信息

  • 总下载量: 2.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2016-08-07