{"flag":true,"single":true,"pageTitle":"Open a password protected website using file_get_contents In PHP","post":{"id":177,"user_id":"1","slug":"open-a-attention-website-using-file-get-contents-in-php-ojhd","title":"Open a password protected website using file_get_contents In PHP","body":"<pre class=\"language-markup\"><code>&lt;?php\r\n$username = 'bateprecios';\r\n$password = 'XrB3hUHLn6R7mbC';\r\n $url=\"http:\/\/www.intercap.com.ar\/API\/rs\/bateprecios\/catalogo\";\r\n$context = stream_context_create(array(\r\n    'http' =&gt; array(\r\n        'header'  =&gt; \"Authorization: Basic \" . base64_encode(\"$username:$password\")\r\n    )\r\n));\r\n$data = file_get_contents($url, false, $context);\r\nprint_r($data);\r\n?&gt;<\/code><\/pre>","category_id":"1","is_private":"0","created_at":"2023-08-16T16:30:45.000000Z","updated_at":"2023-08-17T06:38:31.000000Z","category":{"id":1,"user_id":"1","name":"PHP","slug":"php-3ius","parent_id":null,"created_at":"2023-03-14T03:58:19.000000Z","updated_at":"2023-03-14T03:58:19.000000Z"},"user":{"id":1,"name":"R GONDAL","email":"rizikmw@gmail.com","email_verified_at":null,"two_factor_confirmed_at":null,"current_team_id":"1","profile_photo_path":null,"created_at":"2023-03-12T10:49:33.000000Z","updated_at":"2025-01-10T12:59:00.000000Z","profile_photo_url":"https:\/\/ui-avatars.com\/api\/?name=R+G&color=7F9CF5&background=EBF4FF"}},"pageDesc":"&lt;?php $username = 'bateprecios'; $password = 'XrB3hUHLn6R7mbC';  $url=\"http:\/\/www.intercap.com.ar\/API\/rs\/bateprecios\/catalogo\"; $context  - Open a password protected website using file_get_contents In PHP (Updated: August 17, 2023) - Read more about Open a password protected website using file_get_contents In PHP at my programming site [SITE]","categories":[]}