[ create a new paste ] login | about

Link: http://codepad.org/hmYiNjMJ    [ raw code | output | fork ]

php.programmer - PHP, pasted on May 6:
<?php
// sample file and directory handling functions streams layer 
if(is_dir('/'))
  echo 'in dir';
else
  echo 'its not a directory';

echo PHP_EOL;

if(is_file('/t.php'))
  echo 'is file';
else
  echo 'its not a file';

echo PHP_EOL;


if(is_readable('/t.php'))
  echo 'it\'s redable file';
else
  echo 'its not a redable file';

echo PHP_EOL;


if(is_writable('/t.php'))
  echo 'is writable file';
else
  echo 'its not a writable file';

echo PHP_EOL;


if(is_uploaded_file('/t.php'))
  echo 'its uploaded via http';
else
  echo 'its not uploaded via http';

echo PHP_EOL;

if(is_executable('/t.php'))
  echo 'in executable';
else
  echo 'its not a executable file';


?>


Output:
1
2
3
4
5
6
in dir
is file
it's redable file
is writable file
its not uploaded via http
its not a executable file


Create a new paste based on this one


Comments: