0
 $url = 'http://sfs.dev.pankaj.happlabs.in/api/v1/init'; 

If file name init doesn't exist and whole url is correct how to check that in php.

1 Answers1

1

The JSON at http://sfs.dev.pankaj.happlabs.in/api/v1/init is invalid, so you will get errors. The endpoint appears to be correct though.

To check in PHP however (to answer your question), you can use :

http://php.net/manual/en/function.file-get-contents.php

<?php 

if ($html = file_get_contents('http://cia.gov')) {
    // $html has content
}
delboy1978uk
  • 12,118
  • 2
  • 21
  • 39