第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 PHP 中創(chuàng)建嵌套目錄

在 PHP 中創(chuàng)建嵌套目錄

PHP
jeck貓 2023-05-26 17:30:44
我正在嘗試在網(wǎng)絡(luò)服務(wù)器上創(chuàng)建一個嵌套目錄。代碼創(chuàng)建目錄 $userID"."_blog_images ok,但不是 post_"."$postID"."_images 目錄。我正在使用 Mac。提前致謝。<?php//Create user root image directory if it does not exist    if (!is_dir("$userID"."_blog_images")){        mkdir("$userID"."_blog_images");    }//Create post image directory if it does not exist    if (is_dir("$userID"."_blog_images")){      if (!is_dir("$userID"."_blog_images/post_"."$postID"."_images")){         mkdir("$userID"."_blog_images/post_"."$postID"."_images", 0777, true);      }    }?>
查看完整描述

1 回答

?
ibeautiful

TA貢獻1993條經(jīng)驗 獲得超6個贊

根據(jù)評論部分中提供的信息,您希望在sub-dir父母dir已經(jīng)存在時在其中創(chuàng)建一個


所以你的代碼必須是


<?php

//Create user root image directory if it does not exist

    if (!is_dir($userID."_blog_images/")){

        mkdir($userID."_blog_images");

    }


//Create post image directory if it does not exist

    if (is_dir($userID."_blog_images/")){

        mkdir($userID."_blog_images/post_".$postID."_images", 0777, true);

    }

?>


查看完整回答
反對 回復(fù) 2023-05-26
  • 1 回答
  • 0 關(guān)注
  • 166 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號