config.php$_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 |
'; $_lang[' group_deals ' = ' group deals '; $subject = file_get_contents ("config.php"); $pattern = ' How to write here '; preg_ Match_all ($pattern, $subject, $matches); Print_r ($matches); I want to take out everything after the equals sign, how do I write it? Note the symbols in the string after the equals sign (single quotation marks, double quotes, escaped Fu Yi, and line breaks are taken). The results are as follows: 1. ' New arrivals ' 2. ' Hot ' 3. ' Group Deals ' 4. "Specials" 5. ' Contact Cu\ ' Stomer
Service for |
Order Status and |
Other after-sales issues |
'
Reply to discussion (solution)
Can't think of, you are the number of the group can be directly through the key name to take what to do with the regular! And why are you using file_get_contents to get the data from config.php? You can simply return that array and manipulate it directly through the array.
$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 |
'; $_lang[' group_deals '] = ' Group deals '; TXT; $pattern = '/.*=\s* (. +);/su '; Preg_match_all ($pattern, $subject, $matches); Print_r ($matches [1]);Array
(
[0] = ' New arrivals '
[1] = ' hot Products '
[2] = ' Group Deals '
[3] = "Specials"
[4] = ' Contact cu\ ' Stomer
Service for |
Order Status and |
Other after-sales issues |
'
[5] = ' Group Deals '
)
Technical master, CSDN or quite a lot of.
config.php General include enter the reading group to take a value on the line
=\s ([' "" "a-za-z1-9\s<>\/\\-]*)
=\s* ([' "" "a-za-z1-9\s<>\/\\-]*)
config.php General include enter the reading group to take a value on the line
Well. Arrays can be used directly. But it's not my problem, ha.