I have a quite specific problem. I want to combine every element of an array with neighboring elements to a new array of minimum length 2. Im not sure if Im explaining that correctly so here’s an example: Given the array: I want to create a new array that looks like this: [‘abcd’] is not ret…
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 …
Images from PHPFaker got deleted when stored in storage/app/public/news folder
I have two tables news and images. These two tables have one-to-many relationship (one being news). I’m trying to make a factory on images, but right after I migrate with seed, the image saved to news directory but after one second it got deleted, and the path on the database returns news. I’ve re…
PHP topological sort
LIST: controller name => priority:required controllers sorted and expected output: First sort by priority, then reorder based on required controllers to be loaded before. ensure not to be stuck in an infinite loop due to controllers requiring each other. I assume I’ll need something like this: Please…
Parsing JSON array in PHP that doesn’t have a key value
I am receiving an array in php after making a request but the array doesn’t have a key value. Not sure if I need to parse or convert to an object first. Im using the simple_html_dom PHP library. Here …
laravel run command / cron every 7 seconds on sunday
So i would like to accomplish the a command which runs every sunday but also every 7 seconds on that sunday. The following is from the docs but I don’t have an idea on how to achieve this. Anyone able …
The cookie is not created js
I’m planning a registration system. Right now I’m trying to send a randomly generated session string to the mysql db; besides sending it on db I want to create a cookie with the js that contains the session string. I tried with the following code but I don’t know why the cookie is not genera…
Laravel cannot be installed with php 8 [closed]
Hello I am going to create a project with laravel, I am using composer global installer, with the php version I am using is php 8. but I have a problem when I do the laravel installation. What should …
Pass GET Variable to Modal to use in Query
I am trying to build a budget lookup tool. I have form where someone enters an account#, fund#, and deptID#. When they hit search, it opens a modal and will display a table of the budget balances that match the entered fund, account, and deptID. I can get the modal to open but, I can’t seem to get the d…
Search query function on Laravel
I have an album that has images. I’m having a problem with doing the search function. I want to search for photos with the following caption. Here’s what I did so far. Albums table: | id | album_name |…