How can I get constant name and constant value in file
<p>I have files with texts an constants. How can I get constant name and constant value. Problem is that constant value has sometime spaces. I read files with <code>file()</code> and then with <code>foreach</code>...</p>

<p>Example:</p>

<pre><code>define('LNG_UTF-8',         'Universal Alphabet (UTF-8)');
define('LNG_ISO-8859-1',   'Western Alphabet (ISO-8859-1)');
define('LNG_CustomFieldsName', 'Custom Field');
define('LNG_CustomFieldsType', 'Type');
</code></pre>

<p>I already tried:</p>

<p>to get constant name:</p>

<pre><code>$getConstant1 = strpos($mainFileArray[$i], '(\'');
$getConstant2 = strpos($mainFileArray[$i], '\',');              
$const = substr($mainFileArray[$i], $getConstant1 + 2, $getConstant2 - $getConstant1 - 2);
</code></pre>

<p>to get constant value</p>

<pre><code>$position1 = strpos($file[$i], '\',');
$position2 = strpos($file[$i], '\');');

$rest = substr($file[$i], $position1 + 3, $position2 - $position1 - 2);
</code></pre>

<p>but not working when is space or ','...</p>

<p>How can i make this always working??</p>
