file to base64
$path = 'myfolder/myimage.png';
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
$ echo 'linuxhint.com' | base64
Also in PHP:
- date time format list php
- PHP Startup: Unable to load dynamic library 'curl'
- encode and decode data in php
- eloquent all only one culomn
- clear cache in laravel in windows cmd
- add zeros in front of number php
- date inphp
- How to display MySQL data dynamically using jQuery and PHP
- date("Y/m/d h:i:s") php
- add checkbox in server side datatable laravel
- errors off php
- date funciton
- check sizee string laravel
- add one day to date in php
- array length php
- array to string separated by comma php
- @ 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
- associative array example
- add days in current date php
- detect keyword of php string
- codeigniter echo last query
- binary base64 decode php
- add validation for webp image in laravel
- Connect to SQL in a php PDO and print the data in it