Skip to content

Tag: php

Remove HTML tags from input before sending

I have some chat script and I’m trying to filter the input field before clicking send or submit. This is my input filed: submit when im trying to send some tags like unfortunately is working what i need to do.. remove all attr tags from input or prevent to write html tags inside input because all of thi…

How to prevent Laravel event() from firing during unit tests

I have a class that uses Laravel’s global event() function to fire off a single event when a model is changed. The only way I have been able to prevent this event from firing during unit tests is to actually namespace and declare a new event() function in the test itself and make it do nothing. It works…

My profiler toolbar isn’t showing up in symfony 4.3.1

In my .env file, I have specified my app environment to be dev and debug to be true like so: In my config/packages/dev/web_profiler.yaml file I have the following: The routing within config/routes/dev/web_profiler.yaml seems to be fine: So when I run the server with symfony server:start everything is fine, bu…

What is correct example to use Multi-cURL?

What is correct example (up-to-date approach) use CURL-MULTI? I use the below code, but many times, it fails to get the content (returns empty result, and neither I have experience how to retrieve the correct repsonse/error): and executing: Is there something, that can be changed, to have better results? upda…

Can’t connect to MySQL with PDO

I’m following this tutorial, I’m currently around minute 04:00 and I want to make a connection with my MySQL database through PDO. But my webpage will always give “Could not connect.” when I’m trying …