Extract content using preg_match

i have problem with preg_match, i couldn’t extract a specific content from a certain line
for example, i have the following line :

"ch Aabcd+3 abc - anything (412ms) OK \

i want to extract the content between : "ch and OK \
i have tried this but it doesn’t extract the content as mentioned above

preg_match('(/"ch[^.]?([A-Za-z0-9- ()+]+)[ ]+$/) (/OK/)/s', $line, $sv_content)

can you help me please ?

Does this work for you?

echo substr($line, 4, -5);
1 Like

yes, it does work
thank you so much

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service