Welcome to Geeklog, Anonymous Wednesday, March 26 2025 @ 04:08 am EDT
Geeklog Forums
Static Pages: Returning an array
PHPNewbie
Anonymous
Let me start out by saying I've never used PHP before. I'm migrating some PERL CGI scripts to be used with geeklog. The first thing I tried was passthru(/script/name) as a static page. This worked except it'd always display the results of the script outside the geeklog block. So I tried this:
exec("/script/name", $variable)
return $variable
where the script outputs multiple lines of text. All that appears in the block is the word "Array". Any idea how I can get it to actually print out the entire contents of the array containing multiple lines? Thanks!
exec("/script/name", $variable)
return $variable
where the script outputs multiple lines of text. All that appears in the block is the word "Array". Any idea how I can get it to actually print out the entire contents of the array containing multiple lines? Thanks!
12
11
Quote
PHPNewbie
Anonymous
Well, a friend told me how.. For anyone else curious, here's the easy answer:
return implode("n", $variable);
when $variable is multiple lines.
return implode("n", $variable);
when $variable is multiple lines.
15
13
Quote
All times are EDT. The time is now 04:08 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content