search
HomePHP LibrariesOther librariesPHP interception string class
PHP interception string class
<?php
class get_c_str
{
  var $str;
  var $start_str;
  var $end_str;
  var $start_pos;
  var $end_pos;
  var $c_str_l;
  var $contents;
  function get_str($str, $start_str, $end_str)
  {
    $this->str = $str;
    $this->start_str = $start_str;
    $this->end_str = $end_str;
    $this->start_pos = strpos($this->str, $this->start_str) + strlen($this->start_str);
    $this->end_pos = strpos($this->str, $this->end_str);
    $this->c_str_l = $this->end_pos - $this->start_pos;
    $this->contents = substr($this->str, $this->start_pos, $this->c_str_l);
    return $this->contents;
  }
}

This is a PHP class for intercepting strings. Friends who need it can download it and use it.

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

What are some very useful class libraries or tool libraries for PHP?What are some very useful class libraries or tool libraries for PHP?

06Jul2016

What are some very useful class libraries or tool libraries for PHP?

How Do I Link Static Libraries That Depend on Other Static Libraries?How Do I Link Static Libraries That Depend on Other Static Libraries?

13Dec2024

Linking Static Libraries to Other Static Libraries: A Comprehensive ApproachStatic libraries provide a convenient mechanism to package reusable...

PHP custom Chinese string interception function substr_for_gb2312 and substr_for_utf8 examples, _PHP tutorialPHP custom Chinese string interception function substr_for_gb2312 and substr_for_utf8 examples, _PHP tutorial

12Jul2016

PHP custom Chinese string interception function substr_for_gb2312 and substr_for_utf8 examples. Examples of PHP's custom Chinese string interception functions substr_for_gb2312 and substr_for_utf8. This article describes the use of PHP's custom Chinese string interception functions substr_for_gb2312 and substr_for_utf8.

Why Do PHP Developers Use Leading Underscores in Class Methods?Why Do PHP Developers Use Leading Underscores in Class Methods?

11Nov2024

Hidden Truths: The Leading Underscore in PHP Class MethodsWhen browsing PHP libraries, one might stumble upon class methods prefixed with a...

laravel - What should the standardized PHP class library naming look like?laravel - What should the standardized PHP class library naming look like?

06Jul2016

I have seen many open source projects in the form of class.classname.php, but I have also seen many frameworks in the form of classname.class.php. Where should I place this class? I personally prefer the .class.php form, because in some frameworks, after importing third-party class libraries and specifying class libraries...

Why Do Some PHP Class Methods Start with an Underscore?Why Do Some PHP Class Methods Start with an Underscore?

09Nov2024

Why Do Some PHP Class Methods Begin with an Underscore?While exploring PHP libraries, you might have noticed that certain developers prefer to...

See all articles