Using PHP to re-implement PHP script engine built-in functions _php instances
Source: Internet
Author: User
Really bored, whim, want to put the PHP inside part already provide encapsulated function re-use PHP implementation again,
So the following code is mainly implemented in PHP part of the string processing function, while the implementation of some PHP
No, but the same function as the string handler function, can also be used in other languages to actually
Now, for example with C/vbscript/perl and so on, then you can have your own library of functions.
The following functions do not necessarily run successfully, just to learn.
//
If there is no special statement, all due to Heiyeluren original, to use any function, please retain the author's 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