ให้ไปที่ลิงค์นี้แล้วก็อปURLรูปภาพมา

เริ่มโดย aituanoe, 14 เมษายน 2013, 01:19:16

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

aituanoe

PHP นะคับสามารถทำได้ไหมให้ไปที่
http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&Format=_SL400_&ASIN=B005G8IHT2&MarketPlace=US&ID=AsinImage&WS=1&ServiceVersion=20070822
แล้วมันจะไปที่URLอีกอันนึ่งซึ่งเป็นรูป แล้วเก็บค่านั้นนำมาใช้

ขอบคุณคับ  :wanwan017:

Putter™

#1
<?php
$data get_headers('http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&Format=_SL400_&ASIN=B005G8IHT2&MarketPlace=US&ID=AsinImage&WS=1&ServiceVersion=20070822');
print_r($data);
?>


ลอง

echo $data[3] ;

แบบนี้ปะที่อยากได้  :wanwan017:
[direct=https://hostings.ruk-com.in.th]Ruk-Com Hosting (IAAS)[/direct]
[direct=https://ruk-com.cloud]Ruk-Com Cloud (PAAS)[/direct]
รีวิวโฮสติ่ง Ruk-Com  จากสมาชิก THAISEO

ไม่พอใจยินดีคืนเงินเต็มจำนวนทุกบริการ

aituanoe

#2
อ้างถึงจาก: Putter™ ใน 14 เมษายน 2013, 01:59:26
<?php
$data get_headers('http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&Format=_SL400_&ASIN=B005G8IHT2&MarketPlace=US&ID=AsinImage&WS=1&ServiceVersion=20070822');
print_r($data);
?>


ลอง

echo $data[3] ;

แบบนี้ปะที่อยากได้  :wanwan017:

ใช่คับ ขอถามเพิ่มเติม
Location: http://ecx.images-amazon.com/images/I/41-Jj-I0rOL._SL400_.jpg
ตรงส่วนนี้ผมอยากได้ http://ecx.images-amazon.com/images/I/41-Jj-I0rOL._SL400_.jpg ต้องทำอย่างไรคับ ?


ขอบคุณคับ

Putter™

ถ้าเอาง่ายที่สุดก็ str_replace ทิ้งครับ
[direct=https://hostings.ruk-com.in.th]Ruk-Com Hosting (IAAS)[/direct]
[direct=https://ruk-com.cloud]Ruk-Com Cloud (PAAS)[/direct]
รีวิวโฮสติ่ง Ruk-Com  จากสมาชิก THAISEO

ไม่พอใจยินดีคืนเงินเต็มจำนวนทุกบริการ

aituanoe

Content-Length: 0 ถ้าผมเอาไปใช้แล้วขึ้นอย่างนี้ต้องทำอย่างไรคับ ?  :wanwan017:

Putter™

<?php
$data get_headers('http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&Format=_SL400_&ASIN=B005G8IHT2&MarketPlace=US&ID=AsinImage&WS=1&ServiceVersion=20070822');
$data =implode(' ',$data);
preg_match('/Location: (http:\/\/.+?\.jpg)/',$data,$match);

if($match[1]!='')
{
echo $match[1];
}

?>


เอาไปประยุกดูนะครับ

ถ้า content length เป็น 0 น่าจะ URL ผิด หรือไม่ก็ 404 not found อ่าครับ

ผมไม่แน่ใจว่าคุณจะทำอะไรอ่าครับ ลองส่งตัวอย่างมาดูสิครับ
[direct=https://hostings.ruk-com.in.th]Ruk-Com Hosting (IAAS)[/direct]
[direct=https://ruk-com.cloud]Ruk-Com Cloud (PAAS)[/direct]
รีวิวโฮสติ่ง Ruk-Com  จากสมาชิก THAISEO

ไม่พอใจยินดีคืนเงินเต็มจำนวนทุกบริการ