PHP Curl如何实现长尾关键词的SEO优化?
- 内容介绍
- 文章标签
- 相关推荐
本文共计123个文字,预计阅读时间需要1分钟。
phpfunction native_curl($new_name, $new_email) { $username='admin'; $password='1234'; $url='http://twitter.com/statuses/update.json'; $curl_handle=curl_init();}
function native_curl($new_name, $new_email) { $username = 'admin'; $password = '1234'; // Alternative JSON version // $url = 'twitter.com/statuses/update.json'; // Set up and execute the curl process $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, 'localhost/restserver/index.php/example_api/user/id/1/format/json'); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_POST, 1); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array( 'name' => $new_name, 'email' => $new_email )); // Optional, delete this line if your API is open curl_setopt($curl_handle, CURLOPT_USERPWD, $username . ':' . $password); $buffer = curl_exec($curl_handle); curl_close($curl_handle); $result = json_decode($buffer); if(isset($result->status) && $result->status == 'success') { echo 'User has been updated.'; } else { echo 'Something has gone wrong'; } }
本文共计123个文字,预计阅读时间需要1分钟。
phpfunction native_curl($new_name, $new_email) { $username='admin'; $password='1234'; $url='http://twitter.com/statuses/update.json'; $curl_handle=curl_init();}
function native_curl($new_name, $new_email) { $username = 'admin'; $password = '1234'; // Alternative JSON version // $url = 'twitter.com/statuses/update.json'; // Set up and execute the curl process $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, 'localhost/restserver/index.php/example_api/user/id/1/format/json'); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_POST, 1); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array( 'name' => $new_name, 'email' => $new_email )); // Optional, delete this line if your API is open curl_setopt($curl_handle, CURLOPT_USERPWD, $username . ':' . $password); $buffer = curl_exec($curl_handle); curl_close($curl_handle); $result = json_decode($buffer); if(isset($result->status) && $result->status == 'success') { echo 'User has been updated.'; } else { echo 'Something has gone wrong'; } }

