Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php image to base64

$path = 'myfolder/myimage.png';
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
Comment

php base64 encoded image to png

$img = $_POST['img'];
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = "images/" . uniqid() . '.png';
$success = file_put_contents($file, $data);
Comment

PREVIOUS NEXT
Code Example
Php :: image watermark on image laravel 8 
Php :: if button is clicked php 
Php :: php serve 
Php :: image exists in laravel 
Php :: get word between two characters php 
Php :: code php ajout heure 
Php :: remove double space php 
Php :: php remove html tags 
Php :: create session in php 
Php :: Laravel Unable to migrate or Make Seeds 
Php :: wp_query post by category id 
Php :: woocommerce action order complete 
Php :: php see if undefined 
Php :: how to document php api with swagger 
Php :: php for 
Php :: migrate to an existing table in laravel commad 
Php :: get original name without mutant model laravel 
Php :: php check if url parameter exists 
Php :: get number of chars ina string php 
Php :: remove cookies php 
Php :: php odd or even 
Php :: laravel cmd command to watch logs 
Php :: php artisan up 
Php :: check file selected in php 
Php :: how to exclude csrf in a route laravel 
Php :: php get values that exist in both arrays 
Php :: how to install multiple php versions ubuntu 
Php :: php check if date is bigger than today 
Php :: Cross-site request forgery validation failed. Required param "state" missing from persistent data 
Php :: laravel migrate if not exists 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =