Re: Local variable protection
| From: | kd_jm at hotmail dot com | Date: | Fri, 14 Oct 2011 16:00:44 +0000 |
| Subject: | Re: Local variable protection | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-315301@lists.php.net to get a copy of this message | ||
Hi,
I want to use the function fputcsv, but have the results in a local variable, not a file.
So I thought I could use php://temp
Like in this code sample:
$fp = fopen( "php://temp", 'r+' );
if ( fputcsv( $fp, $data, ",", "'" ) === FALSE )
{
// error
}
else
{
rewind( $fp );
$csvString = stream_get_contents( $fp );
}
This works fine on my local server. What I don't know, if if this will work on another server (with version 5.3 or higher).
In the documentation (wrappers.php.php), it is stated that it is restricted by allow_url_include, but what does that mean?
The explanation on filesystem.configuration.html is sufficiently vague to leave me clueless.
Can anybody enlighten me? Is this code snippet supposed to work on all servers? Even where allow_url_include is false or not set?
Thanks,
Greetings,