Jump to content

Passing Variables in a Variable That Is Inside another Function


GargantulaKon

Recommended Posts

OK, this is confusing so here is what I am trying to do:

 

I am trying to pass a variable that I want to resolve inside another function. How do I do so? Doing the code below actually outputs the PHP code. I tried using the code without escaping, but then the variables are not resoloved. Am I doing it the wrong way?

function Select_Star($Star_Type)
{
switch ($Star_Type)
{
	case "E":
		$HTML = '<img id="Rating_\' . $i . \'" \' . $OnClick . \' onmouseover="Rating(\' . $i . \');" onmouseout="Rating();" src="/Images/Rating_Empty.png" alt="\' . $i . \' Star\' . Add_S($i) . \'" title="\' . $i . \' Star\' . $s . \'" />';
	break;
}
return $HTML;
}

function Rating_HTML($Rating_Number, $User_Mood_ID, $Activated)
{
	for ($i = 1; $i <= 5; $i++)
	{
		$Return .= Select_Star("E");
	}
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.