For more information, see config. php $ _ LANG ['new _ arrival '] & nbsp; & nbsp ;=& nbsp; 'New & nbsp; arrivals'; $ _ LANG ['hot _ products'] & nbsp; & nbsp.
Config. php
$ _ LANG ['new _ arrival '] = 'new arrivals ';
$ _ LANG ['hot _ products'] = 'hot products ';
$ _ LANG ['group _ Demos'] = 'group Demos ';
$ _ LANG ['specials '] = "specials ";
$ _ LANG ['after'] = 'contact cu \ 'stomer
Service |
Order status and |
Other after-sales issues |
';
$ _ LANG ['group _ Demos'] = 'group Demos ';
$ Subject = file_get_contents ("config. php ");
$ Pattern = 'How to write the regular expression here ';
Preg_match_all ($ pattern, $ subject, $ matches );
Print_r ($ matches );
I want to retrieve all the content after the equal sign. how can I write regular expressions?
Note the symbols in the strings after the equal sign (single quotation marks, double quotation marks, escape characters and line breaks must be obtained ).
The result is as follows:
1. 'new arrivals'
2. 'hot products'
3. 'group Demos'
4. "Specials"
5. 'contact cu \ 'stomer
Service |
Order status and |
Other after-sales issues |
'Share:
------ Solution --------------------
$subject =<<< 'TXT'
$_LANG['new_arrival'] = 'New Arrivals';
$_LANG['hot_products'] = 'Hot Products';
$_LANG['group_deals'] = 'Group Deals';
$_LANG['specials'] = "Specials";
$_LANG['after'] = 'Contact cu\'stomer
service for |
order status and |
other after-sales issues |
';