Best software development company, best website designing company, best e-commerce development company,Best mobile app development company

Code For PHP File For Saving The Graph As An Image Inside Your Folder

Given below is the PHP code for saving the graph as an image inside the folder. At Sreyas experienced PHP developers are available for customizing the requirements of clients.

PHP Code for saving the graph as an image
$img_data = $_POST['data']; $id = $_POST['id']; $type= $_POST['type']; session_start(); $_SESSION['chart-image-'.$id] = $img_data; define('UPLOAD_DIR', 'graph'); //'Graph means your folder name' $base64img = str_replace('data:image/png;base64,', '', $img_data); $data = base64_decode($base64img); if($type!=='') { $file = UPLOAD_DIR .'/'.$id.'-'.$type.'.png'; file_put_contents($file, $data); } $review_file = UPLOAD_DIR .'/review-graph-'.$id.'.png'; file_put_contents($review_file, $data);






Leave a Reply

Your email address will not be published. Required fields are marked *

To Know Us Better

Browse through our work.