B
B
boodda2012-12-04 21:12:52
linux
boodda, 2012-12-04 21:12:52

Remove spaces and newlines at the beginning of PHP files

The script clumsily worked out the contents of the files and added spaces and newlines in php files to the beginning, before
<? php

part of the scripts does not work because of this, how can I remove this case from under ssh?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
theaspin, 2012-12-04
@boodda

It is possible through sed, you can stupidly write a script in php - scandir / file_get_contents / trim / file_put_contents

N
nochkin, 2012-12-04
@nochkin

Something like this?

perl -i -ne "next if /^\s*$/;print" script.php

B
boodda, 2012-12-04
@boodda

In general, I went through the PHP script as advised

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question