• I tried the simplest test I could.
    snippet 1:
    <?php
    global $PHPPC;
    $myvar = ‘Hello Mom’;
    $PHPPC::$_vars[“myvaridentifier”] = $myvar;
    echo $myvar;
    ?>

    snippet 2:
    <?php
    global $PHPPC;
    $myvar = $PHPPC::$_vars[“myvaridentifer”];
    echo $myvar;
    echo ‘test completed’;
    ?>

    snippet 2 echos only the ‘test completed’;

    what am I doing wrong?

    https://wordpress.org/plugins/php-code-for-posts/

The topic ‘variables between snippets’ is closed to new replies.