Search
 
SCRIPT & CODE EXAMPLE
 

PHP

check directory exists in php

<?php
$directory = "./videos/category/";
if (!file_exists($directory)) {
  mkdir($directory, 0777, true);
}
?>
Comment

php directory exists

$directory = "/var/www/videos/";
if (file_exists($directory) && is_dir($directory))
{
  echo "Sure, exists and is dir";
}else{
  echo "Not exists. Creating...";
  mkdir($directory, 0777, true);
}
Comment

php check if folder exists


<?php
$filename = '/path/to/foo.txt';

if (file_exists($filename)) {
    echo "The file $filename exists";
} else {
    echo "The file $filename does not exist";
}
?>

Comment

PREVIOUS NEXT
Code Example
Php :: call php from html 
Php :: remove all sessions in laravel 
Php :: ajax get request in laravel 
Php :: Laravel retrieving single record 
Php :: wordpress exclude current post from loop 
Php :: create listener using laravel 
Php :: globals in php 
Php :: php checking if array is multidimensional or not 
Php :: store emoji in php 
Php :: laravel 5.8 cors 
Php :: laravel db ssh 
Php :: laravel update model from request 
Php :: Fetch Data From Database With PDO 
Php :: Yii::app()-request-get yii1 
Php :: aapanel ubuntu 20.04 
Php :: php convert string to boolean 
Php :: xamp to test on mobile 
Php :: ubuntu install php 7 
Php :: laravel select count 
Php :: phpmyadmin reset auto_increment 
Php :: use id as key in co;lection laravel 
Php :: php artisan tinker send email 
Php :: php recursive function to build array 
Php :: yii2 gridview filter exact value 
Php :: ile_put_contents(/opt/bitnami/apache2/htdocs/bootstrap/cache/services.php): failed to open stream: Permission denied 
Php :: composer_update 
Php :: php file extension 
Php :: laravel auth without vue or bootstrap 
Php :: get day by date in php 
Php :: php artisan test 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =