How can i remove part of string from example:
@@lang_eng_begin@@test@@lang_eng_end@@ @@lang_fr_begin@@school@@lang_fr_end@@ @@lang_esp_begin@@test33@@lang_esp_end@@
I always want to pull middle of string: test, school, test33. from this string.
I Read about ltrim, substr and other but I had no good ideas how to do this. Becouse each of strings can have other length for example :
'eng', 'fr'
I just want have string from middle between @@ and @@. to Maye someone can help me? I tried:
foreach ($article as $art) {
$title = $art->titl = str_replace("@@lang_eng_begin@@", "", $art->title);
$art->cleanTitle = str_replace("@@lang_eng_end@@", "", $title);
}
But there
@@lang_eng_end@@
can be changed to
@@lang_ger_end@@
in next row so i ahvent idea how to fix that