Calling a javascript function on a php variable
<p>Javascript:</p>

<pre><code>function capitalizeFL(string) { 
    return string.charAt(0).toUpperCase() + string.slice(1);
}
</code></pre>

<p>PHP:</p>

<pre><code>echo "You have chosen a &lt;script&gt;document.write(capitalizeFL(".$race."));&lt;/script&gt;";
</code></pre>

<p><code>$race</code> contains a string. What I would like is simply to capitalize the first letter of the php variable <code>$race</code>, using the Javascript function above, and print it on the page.</p>

<p>I could find another way of doing this, but this JS-PHP mixing thing is confusing to me and I'd very much like to figure out WHY this doesn't work.</p>
