/    Sign up×
Community /Pin to ProfileBookmark

Hack Repair: I’m using file_get_contents poorly.

Hi all.

I have to get the results of a particular php script into a string. As far as I can tell, the php script won’t present readable data without the use of print_r (perhaps you can tell me of a different way so that I can use it in conjunction with a strstr check).

As a bandaid, I’m currently forced to call file_get_contents(‘http://thelocation.com/thescript.php‘) on the very same server as my project. Locally, it only returns the php data included in the file.

ob_start() is already running, so I can’t make use of ob_start() – grab the ob value – ob_clean() or whatever.

I could use some direction here.

Anyone?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscJun 17.2011 — print_r() takes an optional second parameter you know.....if that helps.

http://php.net/manual/en/function.print-r.php
Copy linkTweet thisAlerts:
@robindeanauthorJun 17.2011 — Excellent. Thank you!
×

Success!

Help @robindean spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...