Welcome Guest, Not a member yet? Register   Sign In
Display session info cleanly??
#1

[eluser]dauber[/eluser]
So...I have a view that displays all the session data, using the documentation-recommended line

Code:
print_r($this->session->all_userdata());

...which WORKS, but...the problem is the array doesn't display nicely...it's in a paragraph rather than with carriage returns. Is there an easy way to add a carriage return after every array element?
#2

[eluser]Tpojka[/eluser]
Can you show how is it presented with some print screen or else?
#3

[eluser]dauber[/eluser]
Screen cap enclosed...from Firefox for OSX...does the same in Chrome and Safari as well.
#4

[eluser]Tpojka[/eluser]
You have got a perfectly formed array. How do you need it to be?
#5

[eluser]noideawhattotypehere[/eluser]
Code:
echo '<pre>';
print_r($this->session->all_userdata());
echo '</pre>';
#6

[eluser]dauber[/eluser]
[quote author="Tpojka" date="1382814235"]You have got a perfectly formed array. How do you need it to be?[/quote]

The array is indeed perfectly formed, which is what I always had.

Let me put it to you this way: Get a copy of the groovy album Pet Sounds. Does the track list on the back look like this?

Quote:Side One: 1) Wouldn't It Be Nice 2) You Still Believe In Me 3) That's Not Me 4) Don't Talk (Put Your Head On My Shoulder) 5) I'm Waiting For The Day 6) Let's Go Away For Awhile 7) Sloop John B Side Two: 1) God Only Knows 2) I Know There's An Answer 3) Here Today 4) I Just Wasn't Made For These Times 5) Pet Sounds 6) Caroline, No

Or does it look like this?
Quote:Side One:
1) Wouldn't It Be Nice
2) You Still Believe In Me
3) That's Not Me
4) Don't Talk (Put Your Head On My Shoulder)
5) I'm Waiting For The Day
6) Let's Go Away For Awhile
7) Sloop John B

Side Two:
1) God Only Knows
2) I Know There's An Answer
3) Here Today
4) I Just Wasn't Made For These Times
5) Pet Sounds
6) Caroline, No

Basically, what I was doing was giving me the first way. I needed a more legible readout.
#7

[eluser]dauber[/eluser]
BTW, noideawhattotypehere gave me EXACTLY what I need. Tried clicking "SOLUTION" but the button didn't work. Firebug tells me:

Quote:SyntaxError: syntax error


(<!doctype html>




Theme © iAndrew 2016 - Forum software by © MyBB