currency convertor in php
<?php
/////for current update currency using api/////
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.exchangeratesapi.io/latest?base=USD",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "{\n\t\"QuantityOnHand\":1,\n\t\"ReOrderPoint\":1,\n\t\"QuantityAsOfDate\":\"2018-03-01\"\n}",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"postman-token: f8326c98-2bb7-a466-6f5e-cb8bfc5421d0"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
$response;
$response= json_decode($response,true);
$CAD= $response['rates']['CAD'];
$AUD= $response['rates']['AUD'];
$GBP= $response['rates']['GBP'];
// echo"<pre>";
// print_r($response);
// echo"</pre>";
?>
Also in PHP:
- cache clear in cpde php laravel
- encode image to base64 in php
- drupal 8 twig filters
- check if the string match in php
- browser cache laravel
- Uncaught RedisException: Redis server went away in
- Illuminate\Database\QueryException SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))
- ddev laravel setup
- create laravel project without template
- clave generator php
- basd64 decrtpy php
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/Users/Public/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
- create laravel project in laravel/laravel
- display_errors php.ini
- cambiar entre versiones de php linux
- @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` npm ERR! Exit status 1
- What is a Regular Expression in php
- chow to check which php version running wordpress
- Laravel image validation example
- create seed file laravel
- check if is in a string php
- date format in day name of month and year in php
- Database name seems incorrect You're using the default database name laravel. This database does not exist. Edit the .env file and use the correct database name in the DB_DATABASE key.
- ReflectionException: Class Magento\Framework\App\Http\Interceptor does not exist in