Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.www.php > #21221 > unrolled thread
| Started by | alex <1j9448a02@lnx159sneakemail.com.invalid> |
|---|---|
| First post | 2016-10-24 09:04 +0200 |
| Last post | 2016-10-24 15:56 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to it.comp.www.php
php://memory non funziona alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-10-24 09:04 +0200
Re: php://memory non funziona Alessandro Pellizzari <shuriken@amiran.it> - 2016-10-24 10:13 +0100
Re: php://memory non funziona alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-10-24 12:49 +0200
Re: php://memory non funziona Alessandro Pellizzari <shuriken@amiran.it> - 2016-10-24 13:12 +0100
Re: php://memory non funziona alex <1j9448a02@lnx159sneakemail.com.invalid> - 2016-10-24 15:56 +0200
| From | alex <1j9448a02@lnx159sneakemail.com.invalid> |
|---|---|
| Date | 2016-10-24 09:04 +0200 |
| Subject | php://memory non funziona |
| Message-ID | <nukbp4$vp8$1@gioia.aioe.org> |
file_put_contents('php://memory', "test\n");
echo file_get_contents('php://memory');
Non viene visualizzato nulla, perchè?
[toc] | [next] | [standalone]
| From | Alessandro Pellizzari <shuriken@amiran.it> |
|---|---|
| Date | 2016-10-24 10:13 +0100 |
| Message-ID | <e761lvF47d6U1@mid.individual.net> |
| In reply to | #21221 |
On 24/10/2016 08:04, alex wrote:
> file_put_contents('php://memory', "test\n");
>
> echo file_get_contents('php://memory');
> Non viene visualizzato nulla, perchè?
php://memory non mantiene le informazioni. Quando lo chiudi, il
contenuto viene perso.
Siccome file_put_contents lo chiude quando ha finito di scrivere, il
file_get_contents non trova niente.
Usa fopen() ... fseek(_, 0) ... fread()
Bye.
[toc] | [prev] | [next] | [standalone]
| From | alex <1j9448a02@lnx159sneakemail.com.invalid> |
|---|---|
| Date | 2016-10-24 12:49 +0200 |
| Message-ID | <nukov0$1llh$1@gioia.aioe.org> |
| In reply to | #21224 |
Il 24/10/2016 11:13, Alessandro Pellizzari ha scritto: > > php://memory non mantiene le informazioni. Quando lo chiudi, il > contenuto viene perso. > > Siccome file_put_contents lo chiude quando ha finito di scrivere, il > file_get_contents non trova niente. > > Usa fopen() ... fseek(_, 0) ... fread() > > Bye. Esempio tratto dal manuale **ufficiale**, e vabè. Cmq ora funziona, grazie
[toc] | [prev] | [next] | [standalone]
| From | Alessandro Pellizzari <shuriken@amiran.it> |
|---|---|
| Date | 2016-10-24 13:12 +0100 |
| Message-ID | <e76c4hF6n24U1@mid.individual.net> |
| In reply to | #21225 |
On 24/10/2016 11:49, alex wrote:
> Esempio tratto dal manuale **ufficiale**, e vabè.
http://php.net/manual/en/wrappers.php.php
php://memory and php://temp and not reusable, i.e. after the streams
have been closed there is no way to refer to them again.
file_put_contents('php://memory', 'PHP');
echo file_get_contents('php://memory'); // prints nothing
Questo è quello che dice il manuale ufficiale. Nota il "prints nothing". :)
Bye.
[toc] | [prev] | [next] | [standalone]
| From | alex <1j9448a02@lnx159sneakemail.com.invalid> |
|---|---|
| Date | 2016-10-24 15:56 +0200 |
| Message-ID | <nul3u8$av6$1@gioia.aioe.org> |
| In reply to | #21227 |
Il 24/10/2016 14:12, Alessandro Pellizzari ha scritto:
> On 24/10/2016 11:49, alex wrote:
>
>> Esempio tratto dal manuale **ufficiale**, e vabè.
>
> http://php.net/manual/en/wrappers.php.php
>
> php://memory and php://temp and not reusable, i.e. after the streams
> have been closed there is no way to refer to them again.
>
> file_put_contents('php://memory', 'PHP');
> echo file_get_contents('php://memory'); // prints nothing
>
>
> Questo è quello che dice il manuale ufficiale. Nota il "prints nothing". :)
>
>
> Bye.
>
ok, grazie ancora :)
[toc] | [prev] | [standalone]
Back to top | Article view | it.comp.www.php
csiph-web