Category: PHP
Category Added in a WPeMatico Campaign
Connection to “process /usr/sbin/sendmail -bs” has been closed unexpectedly. with smtp and laravel
“I tried to send emails with SMTP,Laravel version 9 using Gmail and Outlook, but I keep getting always this error: ‘Connection to “process /usr/sbin/sendmail -bs” has been closed unexpectedly.'”
<?php
namespace AppMail;
use IlluminateBusQueueable; use
IlluminateContractsQueueShouldQueue; use IlluminateMailMailable;
use IlluminateQueueSerializesModels; use
IlluminateSupportFacadesMail;
class DiagnosticMail extends Mailable {
use Queueable, SerializesModels;
private $Data = [];
/**
* Create a new message instance.
*
* @param array $Data
* @return void
*/
public function __construct(array $Data)
{
$this->Data = $Data;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$data = [
'subject' => 'Envoyer un email de test',
'body' => 'hello this is my mail'
];
return $this->view('scanners.emails')
->with($data)
->to('[email protected]', 'Destinataire')
->subject('first mail');
} }
about json is not valid [closed]
if(username !="" && password!=""){
$.ajax({
url: 'insert.php',
type:'post',
data:{username:username,
password:password
},
dataType: 'json',
success:function(response){
alert(response.message);
$('#form')[0].reset();
},error:function(xhr,status,error){
console.error(error);
}
});
}else{
alert("Empty Fields!");
}
when i try to submit it will give me that error on the right side and then online 57 is this console.error(error);

how can do nested laravel transaction
I am using laravel to store records and other operations. My code is:
public function store(Request $request)
{
DB::beginTransaction();
try {
// Start step 1
if($request->steps == 'step1')
{
$filteredKeywords = array_filter($request->keywords, function ($value) {
// Remove null values from the array
return $value !== null;
});
$uniquen_number = $this->generateUniqueNumber();
$videoupload = new Videoupload();
$videoupload->user_id = Auth::id();
$videoupload->unique_number = $uniquen_number;
$videoupload->videostatus_id = 1;
$videoupload->videotype_id = $request->videotype_id;
$videoupload->videosubtype_id = $request->videosubtype_id;
$videoupload->majorcategory_id = $request->majorcategory_id;
$videoupload->subcategory_id = json_encode($request->subcategory_id);
$videoupload->video_title = $request->video_title;
$videoupload->keywords = json_encode($filteredKeywords);
$videoupload->references = $request->references;
$videoupload->abstract = $request->abstract;
$videoupload->declaration_of_interests1 = $request->declaration_of_interests;
$videoupload->acknowledge = $request->acknowledge;
$videoupload->doi_link = $request->doi_link;
if($videoupload->declaration_of_interests1 == 2)
{
$videoupload->declaration_remark = $request->declaration_remark;
}
$videoupload->membershipplan_id = $request->membershipplan_id;
$videoupload->terms_n_conditions = $request->terms_n_conditions;
$videoupload->save();
return response()->json(['success'=>'progress','steps'=>'step2','videoid'=>$videoupload->id,'message' => 'm1']);
}
// End step 1
if($request->hasFile('vide_Upload')){
// Start step 2
if($request->steps == 'step2')
{
$video_details_step2 = single_video_details_without_join($request->videoid);
$uniquen_number = $video_details_step2->unique_number;
$major_category_details = get_majorcategories($request->majorcategory_id);
$folderName = str_replace(' ', '_', $major_category_details->category_name);
$vide_Upload2_image = $request->file('vide_Upload');
$extension = $vide_Upload2_image->getClientOriginalExtension();
$newFileName = $uniquen_number . '.' . $extension;
$filePath = $vide_Upload2_image->storeAs('uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number, $newFileName, 'public');
$video_path_url = asset(Storage::url($filePath));
$video_upload_step2 = Videoupload::find($request->videoid);
$video_upload_step2->full_video_url = $video_path_url;
$video_upload_step2->main_folder_name = 'Videos_to_Revise';
$video_upload_step2->category_folder_name = $folderName;
$video_upload_step2->uploaded_video = $newFileName;
$video_upload_step2->save();
DB::commit();
return response()->json(['success'=>'progress','steps'=>'step3','videoid'=>$request->videoid,'message' => 'm2']);
}
if($request->steps == 'step3')
{
$video_details_step3 = single_video_details_without_join($request->videoid);
$folderName = $video_details_step3->category_folder_name;
$uniquen_number = $video_details_step3->unique_number;
$newFileName = $video_details_step3->uploaded_video;
$vide_Upload2_image_step3 = $request->file('vide_Upload');
$extension_step3 = $vide_Upload2_image_step3->getClientOriginalExtension();
$newFileName_cropped_file = $uniquen_number . '_cropped.' . $extension_step3;
// Start crop the video
$video_path = storage_path('app/public/uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number.'/'.$newFileName);
$croppedVideoPath = storage_path('app/public/uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number.'/'.$newFileName_cropped_file);
$cropped_video_path_url = url('/storage/uploads/Videos_to_Revise/' . $folderName.'/'.$uniquen_number . '/' . $newFileName_cropped_file);
//$ffmpegCommand = "C:/FFmpeg/bin/ffmpeg -i " . $video_path . " -ss 00:00:00 -t 00:00:20 " . $croppedVideoPath;
$ffmpegCommand = "ffmpeg -i " . $video_path . " -ss 00:00:00 -t 00:00:45 " . $croppedVideoPath;
$test = exec($ffmpegCommand);
$video_upload_step3 = Videoupload::find($request->videoid);
$video_upload_step3->short_video_url = $cropped_video_path_url;
$video_upload_step3->save();
// End crop the video
return response()->json(['success'=>'progress','steps'=>'step4','videoid'=>$request->videoid,'message' => 'm3']);
}
if($request->steps == 'step4')
{
$video_details_step4 = single_video_details_without_join($request->videoid);
$folderName = $video_details_step4->category_folder_name;
$uniquen_number = $video_details_step4->unique_number;
$newFileName = $video_details_step4->uploaded_video;
$vide_Upload2_image_step4 = $request->file('vide_Upload');
$extension_step4 = $vide_Upload2_image_step4->getClientOriginalExtension();
$newFileName_cropped_file = $uniquen_number . '_cropped.' . $extension_step4;
$filePath = 'uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number.'/'.$newFileName;
// start encrypting the videos
$highBitrate = (new X264)->setKiloBitrate(1000);
//start encrypting fulllength files
FFMpeg::fromDisk('public')
->open($filePath) // Provide the path relative to the 'local' disk
->exportForHLS()
->withRotatingEncryptionKey(function ($filename, $contents) use ($folderName,$uniquen_number) {
Storage::disk('public')->put('uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number . '/encrypted_files/' . $filename, $contents);
})
->addFormat($highBitrate)
->save('uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number . '/encrypted_files/'.$uniquen_number.'.m3u8');
//end encrypting fulllength files
//start encrypting cropped files
FFMpeg::fromDisk('public')
->open('uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number.'/'.$newFileName_cropped_file) // Provide the path relative to the 'local' disk
->exportForHLS()
->withRotatingEncryptionKey(function ($filename, $contents) use ($folderName,$uniquen_number) {
Storage::disk('public')->put('uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number . '/encrypted_files/' . $filename, $contents);
})
->addFormat($highBitrate)
->save('uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number . '/encrypted_files/'.$uniquen_number.'_cropped.m3u8');
FFMpeg::fromDisk('public')
->open('uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number.'/'.$newFileName_cropped_file) // Provide the path relative to the 'local' disk
->getFrameFromSeconds(3)
->export()
->save('uploads/Videos_to_Revise/'.$folderName.'/'.$uniquen_number . '/'.$uniquen_number.'_screenshot.webp');
//end encrypting cropped files
// end encrypting the videos
return response()->json(['success'=>'progress','steps'=>'step5','videoid'=>$request->videoid,'message' => 'm4']);
}
}
//$videoupload->save();
if($request->steps == 'step5')
{
$video_details_step5 = single_video_details_without_join($request->videoid);
// Assuming $data is the array you provided
$data = $request->name;
$user_details = User::find(Auth::id());
$user_details->role_id = 2; // Change role from member to author
$user_details->save();
$check_role = Userrole::where('user_id',Auth::id())->where('role_id',2)->first();
// 2 means author
if(empty($check_role))
{
$courseoffer = Userrole::updateOrCreate([
'user_id' => Auth::id(),
'role_id' => 2,
],[
'role_id' => 2,
]);
}
$check_role_corresponding_author = Userrole::where('user_id',Auth::id())->where('role_id',7)->first();
// 2 means author
if(empty($check_role_corresponding_author))
{
$courseoffer = Userrole::updateOrCreate([
'user_id' => Auth::id(),
'role_id' => 7,
],[
'role_id' => 7,
]);
}
$check_highest_priority = check_highest_priority($request->majorcategory_id);
if ($check_highest_priority)
{
$get_eligible_editorial_member = $check_highest_priority->user_id;
}
else
{
$get_eligible_editorial_member = get_eligible_user($request->majorcategory_id,$request->subcategory_id);
if (is_object($get_eligible_editorial_member))
{
$get_eligible_editorial_member = $get_eligible_editorial_member->send_to_user_id;
}
else
{
$get_eligible_editorial_member = $get_eligible_editorial_member;
}
}
// Start save into history table
$videohistory = new videohistory();
$videohistory->videoupload_id = $video_details_step5->id;
$videohistory->videohistorystatus_id = 1; // from videohistorystatuses table
$videohistory->send_from_user_id = Auth::id();
$videohistory->send_to_user_id = $get_eligible_editorial_member;
$videohistory->send_from_as = 'Author';
$videohistory->send_to_as = 'editorial-member';
//$videohistory->send_to_as = 'editor-in-chief';
$videohistory->save();
// End save into history table
$request->session()->flash('success', 'Record saved successfully.');
$request->session()->flash('videoid', $video_details_step5->unique_number);
}
DB::commit();
return response()->json(['success'=>'Successfully','redirect' => route('my.account')]);
} catch (Exception $e) {
// Rollback the transaction if any operation fails
DB::rollBack();
// Log or handle the exception
// For example:
// Log::error($e->getMessage());
// Return error response
return response()->json(['error' => $e->getMessage()]);
}
}
In the code. I have to send step wise messages. Like, if one step completes then user will see one step is completed like that.
For this, I’ve added different-different response after completing each step and then call again the store method.
Everything is good.
But I need transaction’s rollback. Means if there occurs any error into any step then all the record must be rollback.
But currently, the record of current step is rolled back, not the transactions of previous step.
Means, if step1 is successfully completed then it will go on step2. Then if any error occurs in the step2, then only step2 records are being rolled back. And records of step1 is not being rolled back. How can I roll back all the transaction?
Raspberry pi nginx PHP execute shell command
I am trying to execute this code with nginx/php 7.3 / wordpress site on my raspberry pi
<?php
$output = shell_exec('v4l2-ctl -d /dev/video0 --list-formats-ext');
echo "<pre>$output</pre>";
?>
The problem is I get no answer If its called from wordpress site. If I manually run shell command
pi@localhost:/var/www/html/wp-content/plugins/RPi/View/main_part $ php 1.php
It works fine.
If I remove “-d /dev/video0 –list-formats-ext” and leave only v4l2-ctlit
<?php
$output = shell_exec('v4l2-ctl');
echo "<pre>$output</pre>";
?>
I get the correct answer on wordpress site (General/Common options list).
Any suggestions what am I doing wrong?
How to make effect of custom elementor control to loop-carousel widget from pro-elements plugin?
I have wordpress site with pro-elements plugin and loop-carousel widget is one of the best widget to set particular category’s products and show in slider. My requirements are like i want to set one brand selector in the elementor settings. Whenever i select and save any brand from that, loop-carousel widget products should belongs to that brand.
I have set custom select control for loop-carousel widget in elementor settings using this hook.
add_action("elementor/element/loop-carousel/section_query/after_section_end", "custom_brand_control");
I have tried to use loop-carousel widget hooks from pro-elements plugin files, tried to use some elementor hooks (given below) also, but unable to get any solutions.
"elementor/element/loop-carousel/section_query/after_section_end" (with $element and $args parameters)
"woocommerce_shortcode_products_query"
High Number of Database Queries and Slow Load Times
I’m running a WooCommerce-based WordPress site with over 1 million products. Lately, I’ve noticed that the page load times have significantly slowed down. After using the Query Monitor plugin to analyze performance, I found that the pages are taking around 18-20 seconds to load, and this is largely due to the high number of database queries being executed by WooCommerce.
To further investigate, I copied my wp_posts table and reduced the number of products to 1,000. However, even with this smaller dataset, the load times were still around 6-8 seconds, which is still quite high.
My questions are:
- How can I reduce the number of queries and improve the load times in WooCommerce and Elementor?
- What are the best practices for optimizing performance for large WooCommerce catalogs?
- What are the recommended caching strategies to address this issue?
- Any advice or guidance would be greatly appreciated!
Additional Information:
- Database: AWS RDS
- WooCommerce Version: 8.6.1
- WordPress Version: 6.5.2
- PHP Version: 8.3.2
- Used Plugins: Query Monitor, Branda, Elementor Pro, Elementor, Google Listings and Ads, Google tarafından Site Kit, Headers Security Advanced & HSTS WP, JetSmartFilters, Loco Translate, WooCommerce, Woodmart Core, Yoast SEO Premium, Yoast SEO, WP Fastest Cache
- Theme: Woodmart
What I’ve tried:
- Analyzing Performance with Query Monitor – Identified high number of queries.
- Using a Caching Plugin – Tried Wp Fastest Cache, but still experiencing performance issues.
- Disabling Unnecessary Plugins – Disabled some unnecessary plugins, but this didn’t have much impact.
- Reducing the Number of Products – Reduced the number of products to 1,000, but load times were still 6-8 seconds.
Apache rewrite engine – Removing PHP extension, getting query string, and appending trailing slash
I recently started working with the rewrite engine and asked for help on removing the PHP extension and adding a trailing slash to URLs. A perfectly working solution was provided by anubhava here. For a quick reference, the configuration file is provided below:
.htaccess
RewriteEngine On
# removes .php and adds a trailing /
# i.e. to externally redirect /path/file.php to /path/file/
RewriteCond %{THE_REQUEST} s/+(.+?).php[s?] [NC]
RewriteRule ^ /%1/ [R=307,NE,L]
# adds a trailing slash to non files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule [^/]$ %{REQUEST_URI}/ [L,R=307,NE]
# internally rewrites /path/file/ to /path/file.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)/$ $1.php [L]
This configuration works as intended for URLs like:
https://example.com/test.php
https://example.com/test
https://example.com/test/
The URLs above are all rewritten to:
https://example.com/test/
So far so good, except that if the PHP file contains a query string, it works a little differently than I would like. For example, if the URL is:
https://example.com/test.php?lang=en&id=3
Then it is rewritten to:
https://example.com/test/?lang=en&id=3
Unfortunately, I did not anticipate this problem, which is causing me issues because I cannot capture the query string in the PHP file below.
test.php
<?php
session_start();
if(isset($_GET['lang']))
{
$_SESSION['lang'] = $_GET['lang'];
}
?>
To resolve this, I need a method to capture the PHP query string. I think rewriting the URL to https://example.com/test?lang=en&id=3/ could work. However, I’m open to alternative solutions.
Userdata array or not?
i’m using a hook to send sms to customer phone and admin phone after form submit…
In user metabox i’d stored a radio button with “allow sms notification” , so the user and admin of course, can choose if receive sms..
now.. the value stored is in array but…
$admindata = get_userdata(1); // 1 is admin
$adminallow = $admindata->user_sms[0]; //working only if set [0]
$customerdata = get_userdata($author_id);
$customer_allow = $customerdata ->user_sms; // work only as is
in my scenario, the admin “allow” working only if extract value from first results [0]..
but if i set the same on customer .. is not working..
so.. theorically value is “array”.. why on customer is taking it without any [0]?
Thanks
Could not connect to AzureDB with Azure AD Access Token from PHP
Im trying to connect to AzureDB from PHP via Microsoft Entra Auth as described below,using sqlsrv driver:
Used script:
<?php
$azureAdServer = 'xxx.crm4.dynamics.com,5558';
$accToken = 'xxx>';
$azureAdDatabase = 'xxx';
// Using an access token to connect: do not use UID or PWD connection options
// Assume $accToken is the valid byte string extracted from an OAuth JSON response
$connectionInfo = array("Database"=>$azureAdDatabase,"AccessToken"=>$accToken);
$conn = sqlsrv_connect($azureAdServer, $connectionInfo);
if ($conn === false) {
echo "Could not connect with Azure AD Access Token.n";
die( print_r( sqlsrv_errors(), true));
} else {
echo "Connected successfully with Azure AD Access Token.n";
sqlsrv_close($conn);
}
?>
always get:
Could not connect with Azure AD Access Token
I can confirm that credentials are correct, connection via c# works, see below:
Do you have any clue if that script working? I’ve spent a couple of hours with this connection and don´t have any other idea. AI fails too.
Thank you in advance for any help.
Michal
Get category title with shortcode whithout a bullet list
i’d like to create a shortcode for wordpress to display the category name.
Each post on the website is associated with only one category, so there is no need to display a list of categories but only one category name.
I have found here this code :
<?php
function categories_list_func( $atts ){
$categories = get_the_category();
if($categories) {
foreach($categories as $category) {
$output .= '<li class="cat-' . $category->cat_ID . '"><a href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "Read more posts from : %s" ), $category->name ) ) . '">'.$category->cat_name.'</a></li>';
}
$second_output = trim($output);
}
$return_string = '<ul>' . $second_output . '</ul>';
return $return_string;
} // END Categories
add_shortcode( 'categories-list', 'categories_list_func' );
?>
The code gives me a partial answer because the result shows a bullet before the category name. How to use the code without showing a bullet before the category name?
importing redis in python script breaks the capture of the python output by the php script that has launched the python script
Version:
redis_version:7.2.4
redis-py : 5.0.3
Platform:
python3.12 on ubuntu22 / php 8.12 on nginx
Description:
I am executing a python process from a php script :
<?php
class execSomePythonScript {
function __construct () {
ob_start();
passthru('/usr/bin/python3.12 pythonProc/testphp.py ';
$output = ob_get_clean();
print_r($output); exit;
}
}
?>
the python script :
import json
output = { "c" : "b"}
print(json.dumps(output))
=> php output as expected { "c" : "b"}
However, importing redis breaks the capture of the output by php
import json
output = { "c" : "b"}
print(json.dumps(output))
import redis
print(json.dumps("c"))
=> cli output
{"c": "b"}
c
=> php output
{ "c" : "b"}
?
Hi, I need get two specific keys along with its value from a set of data to another set of data in php
from this set of arrays:
{
“data”: [
{
“lng”: -90.0333333333333,
“observation”: “KATP 050920Z AUTO 12021KT 10SM SCT020 SCT025 SCT032 26/22 A2989 RMK A01”,
“ICAO”: “KATP”,
“clouds”: “scattered clouds”,
“dewPoint”: “22”,
“cloudsCode”: “SCT”,
“datetime”: “2024-05-05 09:20:00”,
“temperature”: “26”,
“humidity”: 78,
“stationName”: “ATLANTIS OILP”,
“weatherCondition”: “n/a”,
“windDirection”: 120,
“windSpeed”: “21”,
“lat”: 27.2
},
{
“lng”: -91.9833333333333,
“weatherConditionCode”: “BR”,
“observation”: “KGHB 050920Z AUTO 5SM BR FEW020 FEW026 25/23 A2988 RMK A01”,
“ICAO”: “KGHB”,
“clouds”: “few clouds”,
“dewPoint”: “23”,
“cloudsCode”: “FEW”,
“datetime”: “2024-05-05 09:20:00”,
“temperature”: “25”,
“humidity”: 88,
“stationName”: “GARDEN BANKS172”,
“weatherCondition”: “mist”,
“lat”: 27.8333333333333
},
{
“lng”: -91.9833333333333,
“weatherConditionCode”: “BR”,
“observation”: “KGHB 050920Z AUTO 5SM BR FEW020 FEW026 25/23 A2988 RMK A01”,
“ICAO”: “KGHB”,
“clouds”: “few clouds”,
“dewPoint”: “23”,
“cloudsCode”: “FEW”,
“datetime”: “2024-05-05 09:20:00”,
“temperature”: “25”,
“humidity”: 88,
“stationName”: “GARDEN BANKS172”,
“weatherCondition”: “mist”,
“lat”: 27.8333333333333{...}
$latitude = [];
foreach ($decoded as $key => $value) {
for ($i = 0; $i < count($value); $i++) {
$longitude[$i] = $value[$i][“lng”];
}
and simple tried to repeat for lat, but it gives me both arrays separated with no specific keys!{
array {-90.0333333333333, -91.9833333333333, -91.9833333333333}
}
{
array {27.2, 27.8333333333333, 27.8333333333333}
}I want my result like:
{“lng”: -90.0333333333333,”lat”: 27.2}
{“lng”: -91.9833333333333,”lat”: 27.8333333333333}
{“lng”: -91.9833333333333,”lat”: 27.8333333333333}
Json Data to PHP Variable [duplicate]
{
"message":"SUCCESS",
"status":true,
"data":{
"plCollection":0,
"qrCollection":200.0,
"swipeCollection":0,
"cardsQRCollection":0,
"collection":200.0,
"services":{
"orderQr":0,
"swipeActive":0,
"fpActive":0,
"loanActive":null,
"qrLifetimeActive":1
},
"transactions":[
{
"id":10579656190,
"paymentTimestamp":1714884366000,
"internalUtr":"8T0M0T3A7S84184412652945435100","bankReferenceNo":"412652945435","amount":100.0,"payerName":"Sandeep Shukla","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10578829286,"paymentTimestamp":1714880971000,"internalUtr":"8t0m0t3a7s84184449203646770100","bankReferenceNo":"449203646770","amount":100.0,"payerName":"Farjana","payerHandle":"Paytm","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10567105566,"paymentTimestamp":1714812120000,"internalUtr":"8t0m0t3a7s8418441251102242620","bankReferenceNo":"412511022426","amount":20.0,"payerName":"Sandeep Kumar Shukla","payerHandle":"Google Pay","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10564152331,"paymentTimestamp":1714800040000,"internalUtr":"8t0m0t3a7s8418441256034311930","bankReferenceNo":"412560343119","amount":30.0,"payerName":"Mr Sandeep Kumar Shukla","payerHandle":"Google Pay","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10563415540,"paymentTimestamp":1714796673000,"internalUtr":"8t0m0t3a7s8418441252724219920","bankReferenceNo":"412527242199","amount":20.0,"payerName":"Mr Sandeep Kumar Shukla","payerHandle":"Google Pay","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10551709861,"paymentTimestamp":1714726063000,"internalUtr":"8T0M0T3A7S84184412480467427100","bankReferenceNo":"412480467427","amount":100.0,"payerName":"Anurag Rathore","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10537706828,"paymentTimestamp":1714645690000,"internalUtr":"8t0m0t3a7s84184412315876073250","bankReferenceNo":"412315876073","amount":250.0,"payerName":"Javed Abbas","payerHandle":"Google Pay","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10533318429,"paymentTimestamp":1714625621000,"internalUtr":"8T0M0T3A7S8418441238408555510","bankReferenceNo":"412384085555","amount":10.0,"payerName":"Adity Kumar","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10533119938,"paymentTimestamp":1714624675000,"internalUtr":"8T0M0T3A7S8418441231466694250","bankReferenceNo":"412314666942","amount":50.0,"payerName":"Suraj Pandey","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10531700315,"paymentTimestamp":1714616847000,"internalUtr":"8t0m0t3a7s841844123935487671","bankReferenceNo":"412393548767","amount":1.0,"payerName":"Sana Fatima","payerHandle":"Google Pay","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10519479258,"paymentTimestamp":1714545095000,"internalUtr":"8t0m0t3a7s8418441225488894970","bankReferenceNo":"412254888949","amount":70.0,"payerName":"Pradeep Yadav","payerHandle":"Google Pay","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10518882835,"paymentTimestamp":1714542643000,"internalUtr":"8T0M0T3A7S8418441227501570750","bankReferenceNo":"412275015707","amount":50.0,"payerName":"Suraj Pandey","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10508448671,"paymentTimestamp":1714476233000,"internalUtr":"8T0M0T3A7S8418441217360304730","bankReferenceNo":"412173603047","amount":30.0,"payerName":"Shahid","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10507224196,"paymentTimestamp":1714469575000,"internalUtr":"8t0m0t3a7s8418441211841861110","bankReferenceNo":"412118418611","amount":10.0,"payerName":"Dewanti Devi","payerHandle":"Google Pay","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10507147815,"paymentTimestamp":1714469152000,"internalUtr":"8T0M0T3A7S8418441217228828550","bankReferenceNo":"412172288285","amount":50.0,"payerName":"Suraj Pandey","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10506769103,"paymentTimestamp":1714467213000,"internalUtr":"8t0m0t3a7s8418441211662600710","bankReferenceNo":"412116626007","amount":10.0,"payerName":"Pradeep Yadav","payerHandle":"Google Pay","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"bharatpe.8t0m0t3a7s84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10506701265,"paymentTimestamp":1714466894000,"internalUtr":"8T0M0T3A7S8418441213089247220","bankReferenceNo":"412130892472","amount":20.0,"payerName":"Satish Chandra","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"},{"id":10489788483,"paymentTimestamp":1714370639000,"internalUtr":"8T0M0T3A7S8418441205232575620","bankReferenceNo":"412052325756","amount":20.0,"payerName":"Tridev Kumar","payerHandle":"PhonePe","type":"PAYMENT_RECV","status":"SUCCESS","payeeIdentifier":"BHARATPE.8T0M0T3A7S84184","merchantId":49521184,"txnSubType":"SALE"}]}}
My Data is This.
But I want to
$Transaction = transaction all detail
please help me
echo$array = json_decode(json_encode($xml), true);
but its show only array
How to save a div into the DB without canvas size limitations?
I am trying to build a tool where it is possible to create your own personal poster. The users can modify their poster with different images, colors, text, … All of it is contained in a single <div id="divToImage">. I would like to save this div into the database of the website as an image. Therefore I have already tried to use the html2canvas and dom-to-image library. These two libraries try to convert the div into a canvas which makes it possible to save or create a dataUrl of it.
However, the creation of the canvas has some limitations. The maximum amount of pixels on an iPhone is pretty low. It freezes my website when I try to convert the div into the canvas via one of those two dependencies.
So my question is whether there is another way to save the div into the DB without size limitations (because the image will be quite large in size and quality).
Maybe a way to change the increase the maximum size of the canvas on iPhone? …
I am a bit stuck here on the possibilities
