encode image to base64 in php
$path = 'myfolder/myimage.png';
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
Also in PHP:
- dateformt php
- activity log spatie
- Format Month as a number php
- clear database cache laravel command
- array key xists
- character lenght php
- cache and compile file clear laravel
- doubles tennis random function php
- console log with php on form sent
- clear array php
- The key "initial" is not recognized and ignored.
- cronjob cakephp
- current datetime php
- convert string to date php
- Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". php 8
- detect keyword of php string
- Created Migration: laravel
- client's ip address in php
- dynamic url laravel
- base64 encode and decode in php
- check text is in string or not php
- display error on screen
- create a random string in php
- Target class does not exist.