→ bibo9901:$im .. $img 02/23 20:51
→ ontario:sorry ... should be $im ... but it still not works 02/23 20:55
※ 編輯: ontario 來自: 219.84.232.5 (02/23 20:59)
→ bibo9901:怪了 我測很正常耶 一張黑黑的圖片 02/23 21:09
→ ontario:ok...我為了debug,我在L5加了一行echo 'abc'; 02/24 00:02
→ ontario:結果,就不行了。若我把L5的echo 'abc';拿掉,則OK 02/24 00:02
→ ontario:所以這衍生出另外一個問題,為什麼我不能echo一個字串? 02/24 00:03
※ 編輯: ontario 來自: 219.84.232.5 (02/24 00:09)
推 kerash:圖片類型本來就不會有字串產生,當然不能用echo字串 02/24 00:10
※ 編輯: ontario 來自: 219.84.232.5 (02/24 00:11)
→ kerash:我測試過原先的程式碼是沒問題的 02/24 00:11
→ ontario:原來如此。我以為echo的字串會先顯現,imagepng($im)才會 02/24 00:18
→ ontario:顯示圖片。(我以為兩個是分開的)。原來不能混用。 02/24 00:19
→ ontario:謝謝!真的非常感謝!^^ 02/24 00:20
推 kerash:可以在php.net 找header,因為你使用的是 Content-type 02/24 00:23
→ kerash:是將該網頁的類型轉成某個格式(ex:jpg,pdf...etc) 02/24 00:24
→ kerash:其他的 header 方式則會有其他的限制,例如 location 02/24 00:25
→ kerash:在使用header(location)時,該行之前不可有輸出 02/24 00:26
→ kerash:當然也有更改方法(用ob_start or 修改 php.ini) 02/24 00:26