本文整理匯總了PHP中SimpleImage::imageout方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleImage::imageout方法的具體用法?PHP SimpleImage::imageout怎麽用?PHP SimpleImage::imageout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SimpleImage
的用法示例。
在下文中一共展示了SimpleImage::imageout方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
function __construct($path, $thumb_img_resize_width = "200")
{
$answer = NULL;
$this->dir = $path;
$result_files = array();
foreach ($_FILES as $key => $value) {
$path_parts = pathinfo($value['name']);
$extension = $path_parts['extension'];
//$new_name_file = 'img_' . time() . '.' . $extension;
$new_name_file = $value['name'];
if (!file_exists($this->dir)) {
mkdir($this->dir);
}
//Картинки
if ($extension == "jpg" || $extension == "jpeg" || $extension == "gif" || $extension == "png") {
if (file_exists($this->dir . $value['name'])) {
$answer .= $value['name'] . " ";
} else {
//Размер изображения
move_uploaded_file($value['tmp_name'], $this->dir . $new_name_file);
//echo $this -> dir . "/" . $new_name_file;
//print_r($_FILES);
if (!file_exists($this->dir . 'thumb/')) {
mkdir($this->dir . 'thumb/');
}
$new_image = new SimpleImage($this->dir . $new_name_file);
$new_image->imageresizewidth($thumb_img_resize_width);
$new_image->imagesave($new_image->image_type, $this->dir . 'thumb/' . $new_name_file);
$new_image->imageout();
//array_push($result_files, $new_name_file);
}
} else {
if (file_exists($this->dir . $value['name'])) {
$answer .= $value['name'] . " ";
} else {
//Размер изображения
move_uploaded_file($value['tmp_name'], $this->dir . $new_name_file);
//array_push($result_files, $new_name_file);
}
}
sleep(1);
}
echo "ok";
exit;
}