Note that there are some explanatory texts on larger screens.

plurals
  1. POEchoing a string of data from within an include
    primarykey
    data
    text
    <p>I want to echo a string of page specific text. I don't have a problem with this when the tag is on the page but, I am having issues when it is placd within an include. Example:</p> <p>index.php</p> <pre><code>&lt;?php $StringData1 = "String of page specific text on page echoes."; include("IncludeHeader.php"); ?&gt; &lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt; &lt;p&gt;Start Echo Test&lt;/p&gt; &lt;p&gt;Echo Test For StringData1: &lt;?php echo "$StringData1"; ?&gt;&lt;/p&gt; &lt;p&gt;&lt;?php include("IncludeFile.php");?&gt;&lt;/p&gt; &lt;p&gt;Stop Echo Test&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>IncludeHeader.php</p> <pre><code>// Many Global Variables called from various CSV Files. To be exact $StrindData2 is actually $StringData2[1] from an array. The array is of a row of CSV fields $StringData2 = "String of page specific text in include won't echo."; </code></pre> <p>IncludeFile.php</p> <pre><code>Echo Test For Included StringData2: &lt;?php echo "$StringData2"; ?&gt; </code></pre> <p>When index.php is run the output is:</p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt; &lt;p&gt;Start Echo Test&lt;/p&gt; &lt;p&gt;Echo Test For StringData1: String of page specific text on page echoes.&lt;/p&gt; &lt;p&gt;Echo Test For Included StringData2: &lt;/p&gt; &lt;p&gt;Stop Echo Test&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>From this example, how can I get $StringData2 to echo from within the include?</p> <p>Thanks for any help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload