3.137.213.128 |    

Navigation

Google Advertisement

Diese Skript macht das gleiche wie in der Bash der Befehl env und zeigt die Umgebungsvariablen an.

env.php
  1. #!/usr/bin/php
  2. <?php
  3.  
  4. foreach ( $_SERVER as $keys => $value ) echo $keys." = ".$value."\n";
  5.  
  6. ?>
Parsed in 0.010 seconds at 10.21 KB/s

Diesen Befehl kann man in der Commend Line wie folgt ausführen, ohne es erst in einem Skript zu speichern:
tux@earth:~$ php -r 'foreach ( $_SERVER as $keys => $value ) echo $keys." = ".$value."\n";'
Posted by Marko Schulz at 2009-01-03 02:38:22
 

Will man das Skript als CGI Skript und die Ausgabe in HTML haben, kann man folgendes verwenden:
<?php

// file: env.php
foreach ( $_SERVER as $keys => $value ) echo "<b>".$keys."</b> = <i>".$value."</i><br/>\n";

?>
Posted by Marko Schulz at 2009-01-03 02:39:03
 

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)