Re-implement PHP script engine built-in function _php instance with PHP
Source: Internet
Author: User
Really boring, whim, want to put some of the PHP inside the package has been provided to reuse PHP implementation again,
So there is the following code mainly implemented in PHP part of the string processing functions, while implementing a number of PHP
No, but the same function of string processing functions can also be used in other languages to actually
Now, like using C/vbscript/perl and so on, you can have a library of your own.
The following functions are not necessarily able to run successfully, just to learn.
//
If no special statement, all due to Heiyeluren original, to use any function, please retain the author information
{{{strcpy ()
/**
* Use designate sub string Replace string
*
* @param string $str need get sub string variable
* @param int $start start get sub string
* @param int $length need get string length
* @return String Return sub string
* @version v0.1
* @create 2005-5-27
* @modified 2005-5-27
* @author Heiyeluren */
function strcpy ($s 1, $s 2)
{
if (strlen ($s 1) = = NULL)
Return
if (!isset ($s 2))
Return
{{{strcat ()
/**
* Use designate sub string Replace string
*
* @param string $str need get sub string variable
* @param int $start start get sub string
* @param int $length need get string length
* @return String Return sub string
* @version v0.1
* @create 2005-5-27
* @modified 2005-5-27
* @author Heiyeluren */
function strcat ($s 1, $s 2)
{
if (!isset ($s 1))
Return
if (!isset ($s 2))
Return
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service