PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Fri Aug 19, 2005 7:03 am
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...
AnarKy
Forum Contributor
Posts: 119 Joined: Tue Nov 02, 2004 1:49 am
Location: South Africa
Post
by AnarKy » Fri Aug 19, 2005 7:25 am
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>");
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Fri Aug 19, 2005 7:40 am
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']}...
korto
Forum Commoner
Posts: 36 Joined: Thu Aug 18, 2005 6:30 am
Location: Greece
Contact:
Post
by korto » Fri Aug 19, 2005 8:02 am
why? what are you aiming at?
AnarKy
Forum Contributor
Posts: 119 Joined: Tue Nov 02, 2004 1:49 am
Location: South Africa
Post
by AnarKy » Fri Aug 19, 2005 8:04 am
It will be the same sort of thing , I guess,
just change the place at which I split your string up.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Aug 19, 2005 8:41 am
you means something like...
Code: Select all
$pulldown .= strtoupper("<option value=\"".someFunction($row['fullname'])."\">{$row['fullname']}</option><br>");
AnarKy
Forum Contributor
Posts: 119 Joined: Tue Nov 02, 2004 1:49 am
Location: South Africa
Post
by AnarKy » Fri Aug 19, 2005 8:57 am
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...
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Wed Aug 24, 2005 2:40 am
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...
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Wed Aug 24, 2005 4:47 am
why not just do
Code: Select all
$functionvar = functiongoeshere();
$pulldown .= strtoupper('<option value="'.$row['fullname'].$functionvar.'">'.$row['fullname'].'</option><br>");