Regex or a function in php to help edit smokeping config file -


i try make regex catch variables config /etc/smokeping/config.d/targets, , later modify in config of variables , autoreload process.

example text:

+ internet menu = internet title = internet probe = fpinginternet  ++ google menu = google title = google  +++ google-com menu = google.com title = google.com host = google.com  ++ yahoo menu = yahoo title = yahoo  +++ yahoo-com menu = yahoo.com title = yahoo.com host = yahoo.com 

i try make tree in array php like:

array (     name => internet      [0] => array(         menu => internet,         title => internet,         probe => fpinginternet,         [0] => array(             name => google,             menu => google,             title => google,             [0] => array(                 name => google-com,                 menu => google.com,                 title => google.com,                 host => google.com                 ),             ),         ),         [1] => array(             name => yahoo,             menu => yahoo,             title => yahoo,             [0] => array(                 name => yahoo-com,                 menu => yahoo.com,                 title => yahoo.com,                 host => yahoo.com             ),         ),     ) 

there way regex or function can create write in rows?


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -