Posts

Showing posts with the label php

Return Response Image in Laravel 7

3 I'm trying to create a mini random image generator, as a start I've tried : Route::get('/img/UoJb9wl.png','Image@random'); All I did is to return this return '<img src="/assets/fe/img/welcome.jpeg" alt="Smiley face" width="200">'; Then, I tested on the live site : I see the image loaded if I go to the URL https://www.bunlongheng.com/img/UoJb9wl.png If I imported on a site like JSFiddle like this <img src="https://www.bunlongheng.com/img/UoJb9wl.png"> I can't see it. Why ? Edit Try #2 return env('APP_URL').'/assets/fe/img/welcome.jpeg'; I return image path now But I still nothing rendering in my JSFiddle still <img src="https://www.bunlo...

Regex for single digit catches two digit numbers?

2 This regex catches two digit nubers: if I have y11 it will still catch it, how to match only y0, y1, y2, y3, y4, y5, y6, y7, y8, y9 ?? After the digit there might be a blank space or a letter or a dot. preg_replace('/y([1-9]{1})/', 'y0$1', $string) php regex Share Improve this question Follow asked Apr 5 at 10:43 ...