Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7854905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:13:38+00:00 2026-06-02T20:13:38+00:00

For example instead of getting the following post:Array ( a => b, c =>

  • 0

For example instead of getting the following

post:Array (
  "a" => "b",
  "c" => "d"
)

I just get this:

post:Array (\n  "a" => "b",\n  "c" => "d"\n)

It’s really uncomfortable to read this while debugging my code. So if you have any suggestion on why this couldn’t work alright, tell me.

I am running it in a Windows7 Putty connected to an Ubuntu virtual server, which runs supposedly it’s default Apache/PHP configuration. (well probably not, but as always nobody in the team remembers to have changed anything)

edit: Someone requested the code that writes to the error.log:

<?php
error_log(print_r(array("a"=>"b","c"=>"d"),1));
?>

The commands to view the error log are:

sudo tail -f /var/log/apache2/error.log
sudo vim /var/log/apache2/error.log
sudo cat /var/log/apache2/error.log

In all instances the problem occurs that \n is not executed as expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:13:40+00:00Added an answer on June 2, 2026 at 8:13 pm

    I also faced the same problem, but after spending a few minutes I got a solution.

    When you do tail, use as below:

    sudo tail -f /var/log/apache2/error.log | sed -e 's/\\n/\n/g'
    

    If you want, you can create a file. Give it some name and paste the above command and place that in the /usr/bin/ folder.

    For example

    vi tailme
    

    With the contents:

    #!/bin/bash
    tail -f /var/log/apache2/error.log | sed -ue 's/\\n/\n/g'
    

    And put this in /usr/bin/. Now you can use tailme as a command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pretty much following the example on this MSDN page: http://code.msdn.microsoft.com/Imoprt-Data-from-Excel-to-705ecfcd with 1
I have the following code: f=open('data.txt', 'w') conn = urllib2.urlopen('http://example.com') page_html = conn.read() data=BeautifulSoup(page_html)
in this example from opencv, why didn't we create a simple variable img (instead
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
i am using following code to get GPS location. now i want to get
I am using the following code to get the title of a string. Everything
I'm following Steve Sanderson's example from this ASP.NET MVC book on creating a model
I'm trying to get some PHP example code to work on PHP version 5.3.4,
Noob question here. I'm following this example/tutorial to try and isolate a problem I
I am following this example. Only change that I want to make is that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.