script executed in a cron job - best way to format ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mih
Forum Newbie
Posts: 12
Joined: Tue Jul 28, 2009 12:32 am

script executed in a cron job - best way to format ?

Post by mih »

Hello,

I have a php script that I was executing online and that contains lots of echo '<br>'.
Now executing it as a cron job the output of course contains '<br>'

It looks something like

Code: Select all

<br>Total = 1<br>Inserted = 0<br>Updated = 0<br>Deleted = 1<br>Item ID not found = 0<br><br>Folder: sda<br />
What's the proper way to format and nicely have results one after each other ?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: script executed in a cron job - best way to format ?

Post by requinix »

Echo <br>\n instead of just <br>.

Or if this is strictly for cron output, just a \n.
mih
Forum Newbie
Posts: 12
Joined: Tue Jul 28, 2009 12:32 am

Re: script executed in a cron job - best way to format ?

Post by mih »

Thank you again !

I also learned the hard way that

Code: Select all

echo '<br>\n';
will not go to the next line but I have to use

Code: Select all

echo "<br>\n"
Post Reply