Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php if url contains

if(strpos($_SERVER['REQUEST_URI'], "string")) {
  ...
}
Comment

php check if a url exists

function urlExists($url=NULL)
    {
        if($url == NULL) return false;
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $data = curl_exec($ch);
        $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch); 
        if($httpcode>=200 && $httpcode<300){
            return true;
        } else {
            return false;
        }
    }
Comment

php check if string contains url

preg_match('/(http|ftp|mailto)/', $string, $matches);
var_dump($matches);
Comment

PREVIOUS NEXT
Code Example
Php :: migrate single file in laravel 
Php :: show all terms of a custom taxonomy 
Php :: try and catch laravel 
Php :: check if string is number or not php 
Php :: PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: 
Php :: laravel description substring 
Php :: laravel/ui v3.0.0 requires php ^7.3 - your php version (8.0.2) does not satisfy that requirement. 
Php :: content-type application/json php 
Php :: laravel check if array is empty 
Php :: Call to undefined function AppModelsstr_slug() 
Php :: phpexcel set font color 
Php :: php header pdf open in browser 
Php :: check if valid url php 
Php :: get term thumbnail 
Php :: php get current datetime mysql format 
Php :: wordpress Access-Control-Allow-Origin 
Php :: php get array average 
Php :: get thumbnail alt wordpress 
Php :: laravel module create controller 
Php :: blade comment 
Php :: laravel eloquent only today 
Php :: php sec into date time 
Php :: get stock product woocommerce by id 
Php :: php remove nbsp from string 
Php :: session flush laravel 
Php :: base64 decode in php 
Php :: php mysql datetime 
Php :: codeigniter db where between 
Php :: laravel-admin disable batch selection 
Php :: attach multiple files in laravel mailable 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =