like if someone type command “!user 123456” then send message “number banned” I tried this but won’t worked… $ban = array(‘112233′,’123456’); if(strpos($message, “!user $ban”) ===0){ sendMessage($chatId, “<u>Number Banned!<…
Tag: php
PHP MySqli show result for similar terms (Keyword)
Let me explain fast what i want to do! I want to show similar rows from my database by a PHP term. I have a table called “games” and a column called “title” that titles are looks like “Rockstar – GTA V”. So i want to remove all words after dash and use new string as k…
How do I create a eloquent Polymorphic relation
I have a two eloquent models model User and Retailer. I want to create a new model “Task” where there there should be a field “added_by” which can denote either a user or a retailer. How can I create the migration for Task so that there is a field that can denote either user or retaile…
how could I link my HTML project to laravel? [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 last year. Improve this question I’m trying to create a webpage using laravel but there’s not a lot of info online …
Why is the following SQL Query returning an empty result?
I have the following table structures: 1 – Course(course_id, course_nam, language, course_price, create_date, average_rating, category, course_description, certifica_price, course_creator_id) 2 – Student(student_id, wallet) 3 – Discount(discount_id, discounted_course_id, allower_course_creat…
laravel ignore return redirect()
hi guys i’m trying to redirect user to bank but laravel is ignoring my return redirect in here i’m calling pay() in zarinpal class : at the end of redirectToBank() user must redirect to bank but it is ignoring redirect and is returning $order in cheackout() Answer I think that the redirect returns…
How to find value?
I make this associative array with PHP. Now by using array_rand() function => The Output is: [0] => a [1] => b This output shows me only the key of the array. But I want to see the value too. How can I find the value of this array using array_rand()? Answer Use the keys to access the original array
Is there any way to optimize the query while working with 2mil+ rows database table
I am working on Laravel query that shall count the latest month data and also group by week, for the last 3 months. I have tried to fix that in a few ways but still it’s exceeds my memory limit and load very slow. Bellow is the current code that I am using to get the final results – but
Visual Studio Code 1.56 PHP Validation not work
When I upgraded the VS Code from version 1.55 to version 1.56 the inline PHP validator stopped working (onType). I downgraded to 1.55 and everything works. Has anyone had this problem and how can I activate PHP validation in version 1.56? I tried HTML and JavaScript, this two validators works fine. Answer PRo…
str_replace() is not working in aws server returning empty string but working on cpanel and locally
I am developing a laravel ride sharing applicaiton and for the settings data I used a config files. To change any value usign file file_get_contents after that with str_replace and file_put_contents for updating the value. here is some code example: But the $change_content doesn’t return any value in th…