Hi guys
I have a case where data is getting stored in the database as: <!--:en-->Energy<!--:--><!--:fr-->Energies<!--:-->
Now in a given page, I have en or fr, and based on that I need to get the corresponding value.
For example, if I have
I want to get "Energies" by echoing $title.
Any idea ?
PS. The preg_replace is just there for an example, I know the code is not working.
I have a case where data is getting stored in the database as: <!--:en-->Energy<!--:--><!--:fr-->Energies<!--:-->
Now in a given page, I have en or fr, and based on that I need to get the corresponding value.
For example, if I have
Code:
$title = '<!--:en-->Energy<!--:--><!--:fr-->Energies<!--:-->';
$lng = 'fr';
$title = preg_replace('/<!--:'.$lng.'-->(.*?)<!--:-->/i', '$1', $title);
Any idea ?
PS. The preg_replace is just there for an example, I know the code is not working.
Comment