[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] nemt php spørgsmål



On Wed, 26 Jan 2005, Kristian Nørgaard wrote:

> Hvordan tester man på eksistensen af et heltal i en mængde af heltal?
> 
> Der må da være en eller anden måde at skrive noget a la
> 
> $i = 4;
> $numbers = array(1,3,5,6,7);
> if ($i in $numbers){
> 	...
> 	do something
> 	...
> }

in_array

http://dk.php.net/manual/en/function.in-array.php

/hans
-- 
Hamletsgade 4 - 201, DK-2200 København N, Phone: +45 3582 9079
Lejlighed til salg. 2 vær. på 50m² m/altan, kr. 1.150.000,-
50m til Vagabondos. http://www.robinhus.dk/24935


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *