Answer the question
In order to leave comments, you need to log in
How to find a substring in a string using a mask?
Good evening everyone. Help to find the desired substring in the string.
Name options:
oikos_kreos-drape__kr115+an08
oikos_kreos-drape__kr115-an08
oikos_kreos-drape__kr115
oikos_kreos-drape
kreos-drape
Need to get kreos-drape
I try at least like this, but even that doesn't work:
$str = 'oikos_kreos-drape__kr115';
if ( preg_match("/_\D__\D$/", $str, $sample_name) ){
var_dump($sample_name);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question