New line problem in htaccess using php

I’m learning how to edit the .htaccess file using php but i cant seem to get strings to print on a new line. ive tried putting
and \r at the end of sentences but nothing works when i write to the file. is there another way to do it?

Brendan.