18.190.217.134 |    

Navigation

Google Advertisement

Die Funktion in_array() prüft ob sich ein bestimter Wert $needle im Array @haystack befindet. Bei Erfolg wird das gesuchte Zeichen zurück gegeben, andernfalls wird nichts ausgegeben.

in_array
  1. print "OK\n" if ( &in_array( "b", ( "a", "b", "c" ) ) );
  2.  
  3. # *************************************
  4. # Checks if a value exists in an array and
  5. # return the searched expression.
  6.  
  7. sub in_array {
  8.  
  9. my ( $needle, @haystack ) = @_;
  10. return grep{ $_ eq $needle } @haystack;
  11.  
  12. }
  13.  
Parsed in 0.001 seconds at 241.76 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 7 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)