Page 1 of 1
inserting function....
Posted: Fri Aug 19, 2005 7:03 am
by pleigh
i saw some code like this
Code: Select all
$pulldown .= strtoupper("<option value=\"{$row['fullname']}\">{$row['fullname']}</option><br>");
not, how will i insert a function(someFunction()) right after this --><option value=\"{$row['fullname']}\ ???
i did some experimenting but unluckily, i could not get it...
Explain
Posted: Fri Aug 19, 2005 7:25 am
by AnarKy
I am not certain of what you are trying to do...
Do you want to use a function to generate the value displayed by the option?
Perhaps:
Code: Select all
$pulldown .= strtoupper("<option value=\"{$row['fullname']}\">)";
$pulldown .= someFunction($row['fullname']);
$pulldown .= strtoupper("</option><br>");
Re: Explain
Posted: Fri Aug 19, 2005 7:40 am
by pleigh
AnarKy wrote:I am not certain of what you are trying to do...
Do you want to use a function to generate the value displayed by the option?
Perhaps:
Code: Select all
$pulldown .= strtoupper("<option value="{$row['fullname']}">)";
$pulldown .= someFunction($row['fullname']);
$pulldown .= strtoupper("</option><br>");
i need to insert the function after the "" of the first {$row['fullname']}...
Posted: Fri Aug 19, 2005 8:02 am
by korto
why? what are you aiming at?
Same?
Posted: Fri Aug 19, 2005 8:04 am
by AnarKy
It will be the same sort of thing , I guess,
just change the place at which I split your string up.
Posted: Fri Aug 19, 2005 8:41 am
by feyd
you means something like...
Code: Select all
$pulldown .= strtoupper("<option value=\"".someFunction($row['fullname'])."\">{$row['fullname']}</option><br>");

never said
Posted: Fri Aug 19, 2005 8:57 am
by AnarKy
Hey pleigh,
You did not explain what you are trying to do.
But i guess that you are just building a select box
with logical labels instead of what you are storing
(perhaps integers?)
Sorry, I'm just curious...
Posted: Wed Aug 24, 2005 2:40 am
by pleigh
thanx guys...imy idea is to insert the function like
Code: Select all
$pulldown .= strtoupper("<option value=\"{$row['fullname']}\".functiongoeshere()>{$row['fullname']}</option><br>");
i tried this but returns an error...
Posted: Wed Aug 24, 2005 4:47 am
by shiznatix
why not just do
Code: Select all
$functionvar = functiongoeshere();
$pulldown .= strtoupper('<option value="'.$row['fullname'].$functionvar.'">'.$row['fullname'].'</option><br>");