resolve some errors in php logic, like strlen with str containing space that is interpreted as array instead of string

This commit is contained in:
asus
2023-11-08 16:13:25 +01:00
parent 036473d58f
commit 3429d5dda3
41 changed files with 2653 additions and 8 deletions

View File

@@ -0,0 +1,18 @@
<?php
function mp_get_ip() {
$external_ip = "";
// curl with php :
// https://www.php.net/manual/en/function.curl-init.php
$ch = curl_init('https://ifconfig.me/ip');
// CURLOPT_RETURNTRANSFER is set to true, which means that cURL should return the response from the HTTP request as a string, rather than printing it to the screen
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$external_ip = curl_exec($ch);
//mp_console_log("ip:");
//mp_console_log($external_ip);
curl_close($ch);
return $external_ip;
}
?>