Skip to content

live reload not working for php files in vs code

I’ve installed the live server extension on VS code and on google chrome, and configure them to enable live reload but live reload is not working. It was working a few hours ago but now I can’t get it to work. My server I’m using live server: Things I’ve tried: deleting and reinstallin…

Get multiple values from preg_match_all and use of foreach

I have tried to find a solution for my specific problem. I have a regex where I find two specific values. These values need to be combined in a foreach loop. String So I have this regex used with preg_match_all to fetch the alt text and the image itself: I can fetch the results individually by using print_r($…

How can I access the json returned in PHP by my Web Api?

I am using the following code to send and retrieve data from my Web API this is what I get in response I am trying to access the JSON with the following code (Because it worked for me on a similar request): But as you can see the variable $data stopped being a JSON and became a bool(true). Does anyone

Resizing PNG image turns black after upload in PHP

I tried creating a thumbnail for every image uploaded. It includes resizing the image to specified ratio and also converting it to .webp extension. But it turns black after being uploaded. All that I have searched is not working for me, specifically this I also tried saving it into .png using imagepng($resize…

Setting ajax url in external js file in laravel 8

i have a single paged website developed in laravel 8 uploaded on a live server. The site has a contact form which uses ajax to send mail. Am currently having issues with setting the right ajax url. I have checked some solutions online but none have solved the problem. Below are my routes. On the blade header …

Value Old Does Not Work Out When The Form Refreshes

I’m working with Laravel 5.8 and I wanted to add value old() so that when user fills out form and the form gets refreshes (if any error occured), the old value appears as value of input: But now the problem is, it does not show the Old value of user however the form input is filled once. So how to