{"id":14945614,"date":"2021-10-06T23:18:59","date_gmt":"2021-10-06T23:18:59","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/variables-between-php-blocks\/"},"modified":"2021-10-06T23:18:59","modified_gmt":"2021-10-06T23:18:59","slug":"variables-between-php-blocks","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/variables-between-php-blocks\/","title":{"rendered":"Variables between PHP blocks"},"content":{"rendered":"<p>Hi there,<\/p>\n<p>I have a page to show some results of a test depending on GET variable. <\/p>\n<p>In a PHP block, we receive GET variable and process all database queries and calculations. No problem here.<\/p>\n<p>Below, in certain parts of the same page, I need to show values calculated in the first php block. <\/p>\n<p>Something like<br \/>\n&lt;?php echo &#8220;the result of some complex calculation is :&#8221;.$variable; ?&gt;<\/p>\n<p>Where $variable is some of variables calculated in first php block. <\/p>\n<p>However, it shows just the result of some complex calculation is : <\/p>\n<p>Seems to php blocks doesn&#8217;t communicate each other. Is there a solution for that? \u00bfany idea? \u00bfAm i doing something wrong?<\/p>\n<p>Thanks,<br \/>\nLuis <\/p>\n","protected":false},"template":"","class_list":["post-14945614","topic","type-topic","status-publish","hentry","topic-tag-php"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14945614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14945614\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14945614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}