Jump to content
deserty

functie CURL

Recommended Posts

Am urmatorul cod :


<?php
function ia_continutul($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}


$pagina = "https://rstcenter.com";
$continut= ia_continutul($pagina);

echo $continut;

?>

Cum pot pune intr-o variabila doar o bucata cod din ceea ce imi returneaza $continut ?

exemplu : $var="[RST]";

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...