Welcome to Geeklog, Anonymous Monday, December 30 2024 @ 12:16 pm EST

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!
 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.
 Quote

All times are EST. The time is now 12:16 pm.

  • 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