• 0

PHP script help


Question

Hello,

I am trying to create a Script that will grab the checks from Pingdom and output them into a page on my website http://oswestryweather.co.uk/station-status/, i have got the script to grab the checks from Pingdom and print them onto the page however for some reason they won't display on a seperate line, the script i am using can be found here http://pastie.org/2187445

Does anyone know why this might not be puitting all my outputs onto sepearate lines?

Thanks

Richard

Link to comment
https://www.neowin.net/forum/topic/1096971-php-script-help/
Share on other sites

12 answers to this question

Recommended Posts

  • 0
  On 08/08/2012 at 13:18, threetonesun said:

Well, it is inserting the newlines in your code, if you look at the source it looks like this:


Website & Account Centre is down
Server 1 is up
Server 2 is up
Server 3 is up
[/CODE]

What you need is a <br> tag to actually separate it in display.

Well that is interesting, where would i put the BR code in the PHP file to get it to display correctly? If i just go ahead and add <br /> into the php it will error won't it.

  • 0

Exactly. Newlines (and PHP_EOL constant, actually, to be consistent among platforms) are for working with text files. Tags are required for browser output.

But please use <br /> if this is going into production somewhere - gotta have standards, you know :)

print "Error: " . $response['error']['errormessage'] . '&lt;br /&gt;';

  • 0
  On 08/08/2012 at 13:29, Phouchg said:

Exactly. Newlines (and PHP_EOL constant, actually, to be consistent among platforms) are for working with text files. Tags are required for browser output.

But please use <br /> if this is going into production somewhere - gotta have standards, you know :)

print "Error: " . $response['error']['errormessage'] . '&lt;br /&gt;';

+Pouchg you are a star, that has solved it. I wounder why

/n[/CODE]

wasn't working? Does it not work on [u][b]ALL[/b][/u] browsers?

  • 0
  On 08/08/2012 at 13:48, Lilrich said:

+Pouchg you are a star, that has solved it. I wounder why

/n[/CODE]

wasn't working? Does it not work on [u][b]ALL[/b][/u] browsers?

It was working, it's just if you write

a paragraph

like this

in HTML

the web browser doesn't care, and puts it all on one line.

  • 0

I still might be acting really thick here, according to the php manual /n is for creating new lines, from my understanding after posting here this is only for creating new lines in a text output? If i want a browser to render the line break i need to specify that with < br /> is that correct?

  • 0
  On 08/08/2012 at 13:55, Lilrich said:

I still might be acting really thick here, according to the php manual /n is for creating new lines, from my understanding after posting here this is only for creating new lines in a text output? If i want a browser to render the line break i need to specify that with < br /> is that correct?

yes

  • 0
  On 08/08/2012 at 13:55, Lilrich said:

I still might be acting really thick here, according to the php manual /n is for creating new lines, from my understanding after posting here this is only for creating new lines in a text output? If i want a browser to render the line break i need to specify that with < br /> is that correct?

Yes, and if you want your code to render with breaks, you'd use both \n and <br>

This topic is now closed to further replies.
  • Posts

    • Lmao. Cries about not playing those games not installed and yet don't ever want to touch them.
    • If I want to merge folder trees that have a similar structure, Beyond Compare is always my first choice. It's not free but it's awesome. If I want to just scan a whole drive/folder and find duplicates that are taking up space, I like Czkawka.
    • Claude Code gets throttled as Anthropic rolls out fresh usage caps by David Uzondu Claude Code, the AI-in-terminal utility developed by Anthropic and launched back in February, is getting updated usage limits following weeks of user complaints about being abruptly cut off. Many developers on the "$200/month Max plan" found their access blocked after just a few requests, with no explanation from the company. In a recent thread posted to X, the AI lab explained that it has seen "unprecedented demand since launch," pointing to some of its heaviest users who were running the tool continuously in the background 24/7, with one person reportedly consuming tens of thousands of dollars in model usage on a single $200 subscription. Anthropic also claimed that some users were violating its usage policy by sharing and reselling accounts, which impacts system capacity for everyone. These factors all led the company to announce new weekly limits that will be added on top of the existing five-hour caps, effective August 28. Max plan subscribers will have the option to buy additional usage at standard API rates if they hit their cap. Here's what the new weekly limits look like: Pro Plan ($20/month): An estimated 40 to 80 hours of usage with the Sonnet 4 model. Max Plan ($100/month): An estimated 140 to 280 hours with Sonnet 4 and 15 to 35 hours with the top-tier Opus 4 model. Max Plan ($200/month): An estimated 240 to 480 hours with Sonnet 4 and 24 to 40 hours with Opus 4. Per TechCrunch, the company provided these hour-based estimates, noting that the actual numbers may vary based on the size of a project's codebase. What's interesting is how this new structure compares to the old marketing. Anthropic previously advertised its $200 Max plan as offering 20 times more usage than the Pro plan. Based on these new hourly estimates, that multiple is now closer to six. It is possible the 20x figure still applies when measured in tokens or raw compute, but, according to TechCrunch, the company has not clarified that point.
    • I don't give a rat's f### what Trumpette, the Putin puppet likes!
  • Recent Achievements

    • First Post
      Gladiattore earned a badge
      First Post
    • Reacting Well
      Gladiattore earned a badge
      Reacting Well
    • Week One Done
      NeoWeen earned a badge
      Week One Done
    • One Month Later
      BA the Curmudgeon earned a badge
      One Month Later
    • First Post
      Doreen768 earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      645
    2. 2
      ATLien_0
      260
    3. 3
      Xenon
      165
    4. 4
      neufuse
      142
    5. 5
      +FloatingFatMan
      107
  • Tell a friend

    Love Neowin? Tell a friend!