Tags:

How to make html code less repetitive using PHP?


I have a slider with various elements in it and when clicking on a button on a particular element will open a pop-up contain specific details to that selected element. Now my slider is becoming really …

sql, effecting different rows with different buttons

Tags: , ,


i have a project looks like this. i want to view picture then want to write something about this picture. the “gönder” button should effect the right above picture. i want to add these to …

Using both Laravel and non-laravel-PHP

Tags: , ,


I am trying to make Laravel work with a non-laravel script. I need Laravel to handle only routes that are set in the web.php file, and allow anything else that’s not defined to be handled by my non-…

PHP not comparing “#”

Tags: , , ,


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 == “@”)…

Laravel 8: How to style output at Models

Tags: , ,


I want to check if the status of users is Active or not. So in order to do this, I’ve added this piece of code to my Model User.php: public function isActive() { if(($this->status) == 1)…

How to pass slashes in Elasticsearch query using PHP?

Tags: ,


Below mentioned elastic search query which is working fine if we hit it directly, { “query”: { “query_string”: { “query”: “”testtext/123″&…

Tags: php

i am having issues when 2nd input (num2) is entered zero

Tags:


Code 1 for checking input are numeric if ($_SERVER[“REQUEST_METHOD”] == “POST”): if(!preg_match(“/^[0-9]+$/”, $_POST[‘number1’])): $numerr1 = “Please …

Tags:

Matching IDs in 2 different foreach loops in PHP (CodeIgniter)


So basically, what I’m trying to achieve is calculating the tax percentage on each food category. Lets suppose category number 5 having the tax percentage of 8%. So based on simple formula to …

Tags: php wordpress

WP_Query search by meta_key and category_name

Tags: ,


I see how to do multiple meta_keys or multiple category_names, but how do I combine them? $args = array( ‘post_type’ => ‘quotes’, ‘meta_key’ => ‘newsletter’, ‘…

Tags: mysql php

Months name is not showing in German in PHP?

Tags: ,


Hi I am trying to display months name in PHP but it is not showing in German language in MYSQL, my date is showing as 2021-01-23 which I converted into months by using PHP function Month(), MONTH(…