2012-07-22 4 views
2

다음 중 하나를 사용하여 다음 컬링 코드를 PHP 컬 스크립트로 변환 할 수 있습니까? 다음과 같이다음 curl 스크립트를 PHP curl 스크립트로 변환하는 방법?

curl -X POST 'https://api.twilio.com/2010-04-01/Accounts/xxx/SMS/Messages.xml' \ 
-d 'From=%2Byyyy' \ 
-d 'To=%2Bxxxx' \ 
-d 'Body=Dear%2C+Plz+wake+up%3B+it'\''s+time+4+SAHERI.%0D%0AYour+1+night+sacrifice+will+make+thousands+night+wonderful+by+the+grace+of+almighty+ALLAH.%0D%0A%0D%0A-biplob+(%2Bxxxxx)' \ 
-u xxx:yyy 

안부 MD Kamrul 하산

+0

(http://whathaveyoutried.com) –

답변

0

당신이 당신의 컬 핸들을 설정할 필요했던 옵션이 있습니다. [당신이 시도 무엇?]

curl_setopt($ch, CURLOPT_URL, 'https://api.twilio.com/2010-04-01/Accounts/xxx/SMS/Messages.xml'); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, array('From' => 'blah', 'To' => 'blih', 'Body' => 'Please wake up whatever')); 
curl_setopt($ch, CURLOPT_USERPWD, 'username:password'); 
+0

안녕하세요, 감사합니다 당신의 도움을 많이 ..하지만 당신의 도움을 위해 많은 thaks Lusitanian 오류 : – user1544570

+0

안녕하세요 직면 메신저 , 다음 행에 오류가 있습니다. \t \t curl_setopt ($ ch, CURLOPT_POSTFIELDS, array ('From'=> ​​'% 2B11111135135', 'To'=> '% 2B1101111219006', 'Body'=> 2C + Plz + 깨우기 + 3B + 그 + 시간 + 4 + SAHERI % 0D % 0AY + 1 + 밤 + 희생 + 할 + 수천 + 밤 + 멋진 + by + the + grace + + % 0D % 0A % 0D % 0A-biplob + (% 2B1101111219006))); \t PHP 구문 분석 오류 : 구문 오류, 예기치 않은 ';'/home6/siamcomp/public_html/etc/asms.php 온라인 (우리가 게시 필드를 정의하는 행 – user1544570

+0

선생님, 샘플에서 probleb를 발견했습니다. – user1544570