如何在php中修改SimpleImage.php中的
how modifications in php making SimpleImage
修改使得SimpleImage我想对代码做一些调整工作代码是在单个图像中编译带有文本的图像
// making SimpleImage instances of selected friends including main image
$img = new abeautifulsite'SimpleImage('main.jpg');
$img1 = new abeautifulsite'SimpleImage('main2.jpg');
$img2 = new abeautifulsite'SimpleImage('main3.jpg');
$img3 = new abeautifulsite'SimpleImage('main4.jpg');
$img4 = new abeautifulsite'SimpleImage('https://graph.facebook.com/1020534352325130/picture');
$img1->resize(150, 150);
$img2->resize(150, 150);
$img3->resize(150, 150);
$img4->resize(50, 50);
$img->overlay($img1, 'bottom left', 1, 30, -25);
$img->overlay($img2, 'bottom', 1, 0, -25);
$img->overlay($img3, 'bottom right', 1, -30, -25);
$img->overlay($img4, 'top', 1, 0, 25);
$img->text('message', 'fb.OTF', 18, '#FFFFFF', 'top', 0, 20);
$img->save('./dir/' . $_SESSION['gameid2'] . '.jpg');
php制作SimpleImage中的修改我想更改消息的行,但添加了服务器错误500
$img->text('<?php echo $user['name']; ?>', 'fb.OTF', 18, '#FFFFFF', 'top', 0, 20);
我还记得使用变量的图像,但发生了错误
$img4 = new abeautifulsite'SimpleImage('https://graph.facebook.com/<?php echo $user['id']; ?>/picture');
此代码在使用时效果良好,因此
<img src="https://graph.facebook.com/<?php echo $user['id']; ?>/picture" />
<?php echo $user['name']; ?>
请帮忙再见
问题出在<?php
标记的位置上。取而代之的是:
$img->text('<?php echo $user['name']; ?>', 'fb.OTF', 18, '#FFFFFF', 'top', 0, 20);
试试这个:
<?php
$img->text($user['name'], 'fb.OTF', 18, '#FFFFFF', 'top', 0, 20);
?>
取而代之的是:
$img4 = new abeautifulsite'SimpleImage('https://graph.facebook.com/<?php echo $user['id']; ?>/picture');
试试这个:
<?php
$img4 = new abeautifulsite'SimpleImage('https://graph.facebook.com/' . $user['id'] . '/picture');
?>
当然,如果您的代码已经在PHP块中,则可以省略上面示例中的<?php ?>
标记。
相关文章:
- 使用php或javascript从facebook相册URL中删除多余的部分
- 将PHP变量传递给jQuery时遇到问题
- 通过javascript重定向html传递php变量
- 将数组从PHP传递到Javascript
- 如何在php文件中获取$.post-ajax传递的值
- Javascript运行php文件,然后下载文件
- PHP中的setcookie仅适用于localhost
- 如何使用jquery处理php循环通过元素
- 通过Ajax将JavaScript函数传递给PHP文件
- 而循环只设置php中输入字段中的第一个值
- 我需要从php调用javascript或jquery
- 如何通过php页面将数据库值检索到jquery自动完成框中
- PHP AJAX图片上传示例不上传
- 通过php页面中的js强制下载txt
- 如何在PHP中使用$_POST获取Select元素值
- 我想使用模态通过php文件发送邮件,并且我希望在提交关闭后关闭pop
- 如何在php变量中嵌入JQuery代码
- 在PHP中使用javascript更改页面标题'if'
- 如何将字符串值从php页面发送到java脚本页面
- 如何在php中修改SimpleImage.php中的