我在Google和StackOverflow上搜索了我的问题的答案,但我找不到答案.
我想将access_token存储到我的数据库以进行脱机访问,我想确保指定列的正确长度.
我甚至无法找到数字和字符串之间的数字或混合.
我编写了这个简单的代码来保存图像:
// $randomimage contains a random image url.
$content = file_get_contents($randomimage);
file_put_contents('images/'.$randomimage, $content);
Run Code Online (Sandbox Code Playgroud)
我需要一种不重写同名图像的方法。因此,如果我的 /images/ 文件夹中已存在具有特定名称的图像,则不执行任何操作。这很简单,但我不知道该怎么做。