Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    manipolare il buffer prima di spedirlo

    leggo l'output da un file

    readfile($_SERVER['DOCUMENT_ROOT']."/cache/".$urlob);

    e poi la spedisco alla header ob_flush();

    però vorrei poter manipolare il contenuto prima di spedirlo e non capisco come fare.
    Hosting, VPS, SSL e Domini: https://www.blooweb.it

  2. #2
    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  3. #3
    fin quì và bene, ma poi una volta messo in una varibaile e manipolata come faccio a sostituirla al buffer corrente/originario?
    Hosting, VPS, SSL e Domini: https://www.blooweb.it

  4. #4
    Originariamente inviato da powerflash2
    fin quì và bene, ma poi una volta messo in una varibaile e manipolata come faccio a sostituirla al buffer corrente/originario?

    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  5. #5
    con l'ob_get_contents prendo il contenuto del buffer e lo metto dentro una variabile, giusto?
    Hosting, VPS, SSL e Domini: https://www.blooweb.it

  6. #6
    Originariamente inviato da powerflash2
    con l'ob_get_contents prendo il contenuto del buffer e lo metto dentro una variabile, giusto?

    Si.

    Esempio:

    Codice PHP:
    <?php
    // start an output buffer
    ob_start();
    // echo some output that will be stored in the buffer
    echo "This text is in the buffer!
    "
    ;
    echo 
    "This text is in the buffer 2!
    "
    ;
    // store buffer content in a variable
    $bufferContent ob_get_contents();
    //stop and clean the output buffer
    ob_end_clean();
    echo 
    "This text is not in the buffer!
    "
    ;
    echo 
    $bufferContent;
    echo 
    'other output';
    ?>

    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.