php - How can I translate "select from this variable to this variable only" into a code? -


i have 3 variables here.

$first= 'start'; $second = 'end'; $testvar = 'start here , here until end more more more strings here'; 

how can search $testvar if contains start , end strings, , want post start end string only.

another way using substr() , strops()

substr($testvar,strpos($testvar,$first),strpos($testvar,$second)+3) 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -