Skip to content

Tag: php

Sentry Transport errors

I’m trying to implement Sentry in our application. I’ve used sentry/sdk but got some errors (probably due to some PHP settings), so I’m now trying to switch the transport method. I removed sentry/sdk from my composer.json file and replaced it with sentry/sentry and php-http/guzzle7-adapter. …

Laravel Multilayered groupBy

Assume we have this record: While assuming we have this code in our DummyController: And lastly, assuming we have @foreach ($dummyRecord as $dummy_column_name => $dummy) inside our index.blade, we could display the result as such: But I want to display the relation 4’s record of color as a div inside…

PHP not comparing “#”

I have a simple script where I enter some text on my search bar and PHP echo the first character from the text. My code: $data = strval($_GET[‘u’]); $ss = substr($data, 0,1); if ($ss == “@”)…

Can’t figure out a solution to this regex

I have the following list of strings: and the following regular expression which should run on all strings, and if a match is found, return true otherwise, return false. /(?<!hdds)(dtb hdd dtb){1,}(?!shdd)/ As of now, my result set looks something like this: However, for the correct result, would be, to ma…

Fetch json data if json still not created [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 11 months ago. Improve this question This is a sample of my form in php: I take all the values in $_GET and i want to pass them…

Convert PNG files with transparency to WebP using PHP GD

I have a utility class that loads image files and, among other operations, converts them to other formats. It uses PHP GD. Everything works fine except PNG files that have transparency are done wrong when converting to WebP. The result image has a black background where the transparency should be. This is my …