PHP Instagram-API:标题文本不存在 [英] PHP Instagram-API: Caption text does not exist
本文介绍了PHP Instagram-API:标题文本不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将 Instagram-API 用于带有标题的发布图像.我尝试:
I use Instagram-API for the posting images with captions. I try:
$ig->timeline->uploadPhoto($photo->getFile(), ["caption" => "Hello world!"]);
请求已完成,图像已成功上传,但标题为空.
The request is completed, the image is successfully uploaded, but the caption is empty.
当我运行示例 uploadPhoto.php ,该图像也会被加载而没有标题.
When I run the example uploadPhoto.php, the image is also loaded without a title.
我该如何解决?
推荐答案
$photoFilename = Enter Path here;
$photo = new \InstagramAPI\Media\Photo\InstagramPhoto($photoFilename);
$captionText = 'Hello world!';
$ig->timeline->uploadPhoto($photo->getFile(), ['caption' => $captionText]);
运行此代码即可正常工作.
Run this Code it works Properly.
如果出现任何问题,请将您的代码发送给我,我将对其进行纠正.
If Any Issue came then send me your code, I will correct it.
这篇关于PHP Instagram-API:标题文本不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文