0

I need to add after 1 line after match . Whenever there is a match this line should be added. In our case after '{' :

file_put_contents('/var/www/html/ked.log', "\n match", FILE_APPEND);

=================== Example :

After

protected function wrapEJsonPath($value, $delimiter = '->')
{

I want

protected function wrapEJsonPath($value, $delimiter = '->')
{
file_put_contents('/var/www/html/ked.log', "\n protected function wrapEJsonPath", FILE_APPEND);

How can I extract function name and add it into the next line that will be added.

oguz ismail
  • 1
  • 16
  • 47
  • 69
  • 1
    Welcome to SO, please do add your efforts in form of code in your question which is highly encouraged on SO, thank you. – RavinderSingh13 Feb 13 '21 at 05:10
  • See also [Insert line after first match using sed](https://stackoverflow.com/questions/15559359/insert-line-after-first-match-using-sed) – Sundeep Feb 13 '21 at 08:22

0 Answers0