18.191.132.194 |    

Navigation

Google Advertisement

Diese Funktion prüft ob es sich bei der Variable um einen Gültigen Wert für eine HTML Größenangabe wie width oder height handelt. Es muss sich dabei um ein Integer Wert der am Ende px enthält handeln oder ein integer Wert der kleiner als 101 und größer als 0 ist und mit dem Prozent Zeichen endet. Die Funktion gibt TRUE (bzw. 1) oder FALSE (bzw. 0) zurück.

check_width
  1. my $width='101%';
  2.  
  3. print check_width($width);
  4.  
  5. # **********************************************************
  6. # Eingabe von Tabellenbreite checken (1=falsch/0=richtig)...
  7.  
  8. sub check_width {
  9.  
  10. if ($_[0] !~ /^(([1-9])|([1-9][0-9])|(100))(\%|px)$/)
  11.     { return 1; } else { return 0; }
  12.  
  13. }
Parsed in 0.001 seconds at 314.09 KB/s

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

User online
There are 4 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)