Getting a variable to work in function params

Posted on 16th Feb 2014 by admin

I have this fuction which is inside a class:

Code: public static function generateEmbedCode($callId, $width="425", $height="320", $swfobjectPath="SDK/js/swfobject.js", $inviteButton="1", $guestList="1", $observerMode="0", $displayName="$nick") {
Blah Blah
}
What i need to do is grab some info and place it into a variable for $displayName="$nick" using:
Code: $memberid = (int)$_COOKIE['memberID'];
$sQuery = "SELECT * FROM `Profiles` WHERE `ID` = '$memberid'";
$result = db_res($sQuery);
while ( $p_arr = mysql_fetch_array( $result ) ) {
//get profile data
$nick = $p_arr['NickName'];
}
But I can't get it to work, my question is how can I get a variable to work inside the params of a function?? i hope this makes sense.

Thanks

Other forums