Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. array (
  2. 0 => 'HTTP/1.1 200 OK',
  3. 1 => 'Date: Mon, 17 Jun 2019 19:32:37 GMT',
  4. 2 => 'Server: Apache/2.4.38 (Win32) OpenSSL/1.1.1a PHP/7.2.15',
  5. 3 => 'X-Powered-By: PHP/7.2.15',
  6. 4 => 'Set-Cookie: Avisistema=ihk9t1ms6r8i0u1j5t6jpjrqei; path=/; HttpOnly',
  7. 5 => 'Expires: Thu, 19 Nov 1981 08:52:00 GMT',
  8. 6 => 'Cache-Control: no-store, no-cache, must-revalidate',
  9. 7 => 'Pragma: no-cache',
  10. 8 => 'Set-Cookie: Avisistema=ihk9t1ms6r8i0u1j5t6jpjrqei; expires=Tue, 18-Jun-2019 03:32:37 GMT; Max-Age=28799; path=/; HttpOnly',
  11. 9 => 'Set-Cookie: SageFirmeware=Avisistema.A.0.2015.01.10; expires=Tue, 18-Jun-2019 03:32:37 GMT; Max-Age=28799; path=/; HttpOnly',
  12. 10 => 'Content-Length: 232',
  13. 11 => 'Content-Type: application/json',
  14. )
  15.  
  16. //array construct:
  17. $header = array_filter(explode(PHP_EOL, substr($Data, 0, curl_getinfo($ch, CURLINFO_HEADER_SIZE))));
  18. //Array Walk ...
  19. foreach ($header as $line) {
  20. $leed = explode(':', $line);
  21. if (strpos($leed[0], "Content-Type") !== false) {
  22. $head = str_replace(' ', '', $leed[1]);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement