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 :: disable laravel debugbar 
Php :: laravel random string 
Php :: php uppercase 
Php :: get child theme path in wordpress 
Php :: timestamp false in laravel 
Php :: wc get product image 
Php :: laravel return back with success 
Php :: read json file data using php 
Php :: php get current domain 
Php :: pdo last insert id 
Php :: date now php 
Php :: php get user agent 
Php :: php time script 
Php :: laravel check collection not empty 
Php :: php date + one day 
Php :: how to connect database in php 
Php :: how console log laravel 
Php :: Root composer.json requires php ^7.2.5 but your php version (8.0.6) does not satisfy that requirement. 
Php :: laravel check if array is empty 
Php :: ubuntu install php mongodb extension 
Php :: laravel carbon time format AM PM 
Php :: debug wordpress 
Php :: php get file contents 
Php :: +1 month php 
Php :: max_input_time in wordpress 
Php :: laravel ide helper 
Php :: laravel eloquent only today 
Php :: php shorthand if isset post 
Php :: php script to generate random date 
Php :: remove public in laravel hosting 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =