What is cURL, Install in PHP
cURL, which stands for client URL, is a command line tool that developers use to transfer data to and from a server. At the most fundamental, cURL lets you talk to a server by […]
cURL, which stands for client URL, is a command line tool that developers use to transfer data to and from a server. At the most fundamental, cURL lets you talk to a server by […]
How to remove all symbol to string only in PHP, use preg_replace: preg_replace(‘/[^\p{L}\p{N}\s]/u’,”, $x) Sample remove all symbol end characters: <?php $x=’SSS abc saple sym@ “” 1 <> CK2‘; echo $str = preg_replace(‘/[^\p{L}\p{N}\s]/u’,”, […]
Jika ada pesan error php halaman dashboard phpmyadmin saran di update, upgrade saja ke versi terbaru sehingga pesan error akan hilang, cara ini bekerja secara baik untuk sql versi 5, 7, 8 serta […]
The json_decode() function is used to decode or convert a JSON object to a PHP object. Example: $jsonobj = ‘{“Peter”:35,”Ben”:37,”Joe”:43}’; $obj = json_decode($jsonobj); echo $obj->Peter; echo $obj->Ben; echo $obj->Joe;
PHP has some built-in functions to handle JSON. Objects in PHP can be converted into JSON by using the PHP function json_encode(): PHP file <?php $data->name = “John”; $data->age = 30; $data->city = “New […]
Sample data JSON: <php $get_url='{ “countries”: [ { “name”: “United States of America”, “code”: “US”, “city”: “New York” }, { “name”: “India”, “code”: “IN”, “city”: “New Delhi” }, { “name”: “China”, “code”: “CN”, […]
?: is like a gate that lets anything falsy through – including NULL Anything falsy: 0, empty string, NULL, false, !isset(), empty() Same like old ternary operator: X ? Y : Z Note: ?: will throw PHP NOTICE on undefined (unset or !isset()) variables Use of ?: checking empty(), !isset(), is_null() etc shorten ternary operation […]