回答編集履歴
1
追記
test
CHANGED
@@ -43,3 +43,21 @@
|
|
43
43
|
|
44
44
|
|
45
45
|
preg_match を利用してもできることはあくまで文字列の加工だけであって、画像の加工はできるものではありません。何か肝心なところの説明が抜けているのか、「自動リサイズ」という用語の解釈にズレがあるのか、いずれにしても誤解の生じない具体的な説明が欲しいところです。
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
---
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
```php
|
54
|
+
|
55
|
+
function auto_image($filename, $width, $height) {
|
56
|
+
|
57
|
+
$html = '<img src="{$filename}?width={$width}&height={$height}&type=resize" width="{$width}" height="{$height}">';
|
58
|
+
|
59
|
+
return $html;
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
```
|