2011-12-10 202 views
0

所以我有我的PHP文件接收文件,并保存它。工作正常。但是,我想它生成缩略图,以及(使用http://abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/图片上传+缩略图生成器

这里是我当前的代码:

<?php 

$destination_path = getcwd().DIRECTORY_SEPARATOR . '/uploads/'; 

$result = 0; 

$target_path = $destination_path . basename($_FILES['myfile']['name']); 

if(@move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) { 
    $result = 1; 
    square_crop($target_path, 'thumb.jpg'); 
} 

?> 

当我尝试使用square_crop($target_path, 'thumb.jpg');我上线得到了解析错误if($image[0] &gt; $image[1]) {

我用错了吗?谢谢

回答

4

&gt;>的HTML实体 - 我有同样的问题,当我复制从网站代码 - 只需更换的&gt;>所有情况下,你是好去!

+0

如此明显,我可能需要一些睡眠。感谢虽然:) – Johan

+0

花了我一会儿才弄清楚起初:) –

1

它不应该是>而不是&gt;