Hi,
just take a look at this function:
http://www.php.net/manual/en/function.array-keys.php
__
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
--
PHP General Mailing
dont know of a function but this should work
$size = count($array);
for($i=0;$i<$size;$i++){
if($selected_person == $array[$i]){
echo"index: $i";
}
}
Adrian
Ross wrote:
Hi,
I have an array
$people= array ("ross", "bob", "chris")
I have a variable
$selected_person = "chris"
Hi,
I have an array
$people= array ("ross", "bob", "chris")
I have a variable
$selected_person = "chris"
I want to do the find out the index of the $selected_person in the $people
array. Is there a function that can do this??
ta,
Ross
--
PHP General Mailing List (http://www.php.net/)
T
This probably isn't the most elegant method either, but this is how I did
it:
function mark_sel($value, $option) {
// Compare the actual value ($value) to a possible value ($option) to
determine
// if the possible value should be marked as "selected" in a form element.
if ($value == $optio
I am sure my solution is not the most elegant, but this is what I did:
ALABAMA
?>
""Hasbullah Pit (sebol)"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have this one :-
>
>
> Penuh
> Sep
I have this one :-
Penuh
Separuh
Sendiri
and a field of table which contained with
'Penuh' OR 'Separuh' OR 'Sendiri'
I want to make it Ither one is 'selected' during a particular time.
i'm thinking of having something like this:-
>Penuh
>Sepa
Hi,
The $article_active comes from a session and I want be able to select the
radio button (which ever one, yes or no) when the user comes back to the page.
I think thats a bit clearer :-)
Jord
On Saturday 14 April 2001 15:12, you wrote:
> I'm not sure I understand. In the first loop you are s
I'm not sure I understand. In the first loop you are seing if
$article_active equals y. And no where in the code do you set
$article_active to anything else.
Why would you think $article_active would be anything but "y" or "n"?
--
Plutarck
Should be working on something...
...but forgot what it
Hi,
I think I'm being stupid. Why won't this code work. The $article_active
variable is showing y when I echo it?
if($article_active == 'y') {
echo"Yes";
} else {
echo"Yes";
}
if($article_active == 'n') {
echo"No";
} else {
echo"No";
}
Thanks,
Jor
your checking the value every time you loop so that you can see if that value is
checked or not. Im sure Ive missunderstood your question... please email.
select_array('', 'country', '');
echo "
";
foreach($result as $pos => $val)
{
$this_country = $val['country'];
echo "
$t
Hi,
Working on a code that uses a select/option field. All my other fields
are passing through to the form processing software just fine. Meloni's
PHP Essentials does this funky thing, declaring each function value as
selected or not although she shows it with the individual values not
with var
> Hey all. Does anyone have any ideas how I can carry over a selected
value?
> :) It's probably easy but my mind is making it difficult. A value is
> stored for a record in the DB which had been previously assigned through a
#get all the possible options into an array $options
$options = array
Hey all. Does anyone have any ideas how I can carry over a selected value?
:) It's probably easy but my mind is making it difficult. A value is
stored for a record in the DB which had been previously assigned through a
select statement. If that record gets edited, the value that was chosen
thr
13 matches
Mail list logo