Skip to content

Return a substring of a string if exists

I need to extract console platform from the description of products in CSV file. I used regex to match all the console brands that are included in the list. This is for WP All-Import plugin PHP …

Getting a 403 error when using Google Indexing API

I am trying to send a POST request via the Google Indexing API, but keeps getting HTTP erro 403 (Forbidden). My code is below: My full response is as follows: I understand what “Forbidden” means, but I can’t understand WHY I am getting the error. I have followed the instructions for setting …

Sweet Alert Delete Confirmation with a href

Im using PHP, and Sweet alert for a delete confirmation. Problem is that it is deleting before showing the sweet alert. This is my HTML(which is using PHP in it). This is my sweet alert } The problem is, its not showing the sweet alert, its just going straight to the URL. Do I need to do a form and

How to check user input in laravel

I have a column input named Address, and how to check, if user input like null, ‘null’ and ” , the return response will be error. I have make it, but it not working. This is my code: Answer You may use the empty function, which would return FALSE if var exists and has a non-empty, non-zero v…

How to get an OAuth 2.0 token in PHP?

I need to connect to a REST API of a customer. The first step is to get an OAuth 2.0 access token. I got the following information from the customer: Login (I assume it’s the client_id) Password (I assume it’s the client_secret) The flow is password The regular API URL The Token API URL I found co…