Support » Plugin: PHP Everywhere » Shared variables

  • Resolved Flankerator


    Hello Alex,
    Very nice plugin, simple and does the job well.

    When having multiples php instances that share same variable, i noticed that I have to include same variable in each instance, so basically when updating variables, I would have to do it in all instances every time.

    Is there a way to have one instance where I update the variable and then it shares it across all instances that are posted on same page?

    //master update here
    echo $date1;
    echo $date2;

    Many thanks.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Alexander Fuchs


    Hi Naim,

    this should already work. You can just put rhe variable assignment outside of the instance.

    Like this:


    //master assignment here
    $text = ‘Hello word’;
    if($instance == “1”)
    echo $text;

    Let me know if it works for you.

    It worked, thanks Alex!

    the UI box is tiny to edit long code but i could copy paste back and forth between wp and a notepad.


    • This reply was modified 11 months, 3 weeks ago by Flankerator.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shared variables’ is closed to new replies.