fork download
  1. <?php
  2.  
  3. $r = [
  4. 'example.com',
  5. 'http://e...content-available-to-author-only...e.com',
  6. 'http://w...content-available-to-author-only...e.com',
  7. 'https://e...content-available-to-author-only...e.com',
  8. 'https://w...content-available-to-author-only...e.com'
  9. ];
  10.  
  11.  
  12. foreach($r as $url){
  13. //echo substr($url, 0, 7) . "\n";
  14. if (strrpos($url, "http") !== 0) {
  15. $new_url = "http://" . $url;
  16. echo "Changed $url to $new_url\n";
  17. } else
  18. echo "No change to $url\n";
  19. }
Success #stdin #stdout 0.02s 23688KB
stdin
Standard input is empty
stdout
Changed example.com to http://e...content-available-to-author-only...e.com
No change to http://e...content-available-to-author-only...e.com
No change to http://w...content-available-to-author-only...e.com
No change to https://e...content-available-to-author-only...e.com
No change to https://w...content-available-to-author-only...e.com