Skip to content

php scandir for given $q search query

i have search values like “search value” (defined as $q) and .txt files called “search value.txt” in /mydir/ directory. How can i scandir /mydir/ for the search value ($q) and put …

split each HTML tag into new line using PHP

I’m going to split each HTML tag into a new line. This is my source: And I’m gonna have it like this: or like this: And this is what I’ve done: and this is the output with put each “>” in a separate line (array member). Answer Instead of using a regex and splitting your source…

Identify Laravel Package using File Structure

Description: I’ve task to integrate some PHP MVC project in my Laravel Project whereas I’m Laravel Developer in which I’m getting error Not Defined Error. Therefore, I’m trying to understand this project. Hence, I’ve made this question to identify the framework. Below is my File …

how to convert $request format in laravel

I search around for a bit but found nothing that did exactly what I’m after nor anything that really aided me in achieving what I’d like I have data in this format: I’d like to convert it all to this format: i tried: but get no success Answer You got it the other way around. You need to loop…

PHP round() bug with round(908.5449, 2, PHP_ROUND_HALF_UP) = 908.54?

I am currently investing a rounding problem in PHP. I’ve tested it here https://3v4l.org/NpRPp and it seems to be the same, since ever. But is this correct behaviour? Because i expected the following. Can someone tell if this behaviour is intended, and if so, how to solve it properly for every possible …