Getting a variable to work in function params


Posted on 16th Feb 2014 07:03 pm 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
Did you know?Explore Trending and Topic pages for more stories like this.
}
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
No comments posted yet

Your Answer:

Login to answer
307 Like 8 Dislike
Previous forums Next forums
Other forums

Auto fill in input value based on User_ID
Hello,

I'm looking form some input on the following problem.

User loads page ->

Sorting JTable on more than just the values listed in the columns
I have a collection of objects that store (among other things) two integer values. I only want to di

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.

// foreach

Stuck with preg_replace
Hi,

I'm trying to use preg_replace to remove part of the IP address submitted using a form on

batch file not building to webapps folder
Hello. I just started running Vista :P and can't seem to get my projects deployed. I found out how

Force download script not handling files with spaces properly
I have a regular old php force download script, uses this code:

Code: header("Cache-Cont

get the country of visitor and display content based on that
Hello all,

I have seen that Google analytics can tell you where a visitor is coming from and

php is not recognized as an internal or external command
Hello,

I am trying to bake the code in CakePHP through my console.
I have changed my Path

PHP template help
Ok, I don't know if anyone can help me but I am using PHP templates to make a site. I am a newbie an

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash