Home > Article > Backend Development > How to intercept a string between specified 2 characters in php_PHP tutorial
In php, you only need to determine the stripos position before string 1 and string 2 and then use substr to start intercepting That’s it, here’s a simple example for you.
Usage:
|
$keyword='Search (group experiment)'
$need=getNeedBetween($keyword, '(' , ')' );
|
After running the program:
|
$need='Group experiment'; |