grep/search for multiple lines in a file.
- by GSto
Let's say I have a file with a long nested array, that's formatted like this:
array(
'key1' => array(
'val1' => 'val',
'val2' => 'val',
'val3' => 'val',
),
'key2' => array(
'val1' => 'val',
'val2' => 'val',
'val3' => 'val',
),
//etc...
);
what I would like to do is have a way to grep/search a file, and by knowing key 1, get all the lines (the sub-array) it contains. is this possible?