1,465,941 questions
0
votes
1
answer
388
views
How to dynamic background image in WordPress?
I am trying to develop a WordPress theme. For this, I am developing a shortcode for a slider. The HTML template use background images for the slider. I am using get_template_directory_uri() function ...
-1
votes
3
answers
55
views
How to enqueue custom CSS and JS files in a WordPress child theme? [closed]
I'm building a custom WordPress theme for a client and using a child theme.
I want to enqueue my custom CSS (style.css) and a JavaScript file (custom.js) located in the child theme's folder.
Here’s ...
2
votes
2
answers
304
views
Group 2d array data by one column, and group, filter, sort comma-separated values in other columns per group
I have some PHP variable sets from which I'm making a multidimensional array. Now, in that array, I want to check for a particular key ([font]) for duplicates.
If duplicates found, the corresponding ...
-1
votes
0
answers
23
views
INSERT statements freeze while executing through PHP
I have a WAMP server running a PHP script that reads a JSON file and uses the mysqli extension to insert data into multiple tables in MySQL (InnoDB).
There are 5-6 of these loops that insert data into ...
26
votes
3
answers
8k
views
IIFE (Immediately Invoked Function Expression) in PHP? [duplicate]
I wonder if PHP has any equivalence of IIFE (Immediately Invoked Function Expression) like that of Javascript. Can PHP Closure be written anyhow so it can work similarly to Javascript (invoking, ...
0
votes
0
answers
256
views
How to retrieve array wise data of a specific column for an id in Laravel
I want to retrieve array wise data from a specific column of a specific id.
Suppose I have a table named product_wise_ingredients_tbl.
product_id ingredient_id quantity
---------- ------------- ...
-2
votes
1
answer
8k
views
Class 'PhpOffice\phpspreadsheet\src\PhpSpreadsheet\Spreadsheet' not found in Laravel [closed]
In my Laravel project I have used the PhpOffice Spreadsheet for downloading data as excel format from a datatable.
For doing that I need to add code in my controller, route and view.
Controller
I have ...
0
votes
2
answers
100
views
Laravel 12.x, subdomain and Mail::send() error
I'm developing an application where the admin section is accessible via a subdomain like admin.mysite.test.
Everything works fine except sending emails with login credentials for users manually added ...
0
votes
0
answers
905
views
Catching 7z error in PHP - Wrong Password
I need to catch a wrong password error when running 7z in a php script so I can notify user PW needs to be changed.
$strCommandLine = "7z e '$zippath' -p'password' file.name";
system($...
1
vote
1
answer
46
views
Zoom to text in embeded PDF drawing in Mozilla Firefox
I have an app in PHP/HTML/CSS (and a bit of JavaScript) intended for Mozilla Firefox.
App architecture is homemade MVC (not relevant) but it is using "nice URL".
There are two pages:
...
133
votes
8
answers
297k
views
Convert array to CSV and force download
I'm trying to convert an array of products into a CSV file, but it doesn't seem to be going to plan. The CSV file is one long line, here is my code:
for($i=0;$i<count($prods);$i++) {
$sql = "...
1
vote
1
answer
40
views
Using Eloquent ORM Outside of Laravel - Getting Error: Unsupported driver [oracle]
PHP Version 7.4.33
I am trying to use Eloquent outside of Laravel and it is throwing the error "Unsupported driver [oracle]" Apparently there is still some connection that needs to be made ...
-1
votes
0
answers
27
views
How to logout from MS Entra ID?
I have a SaaS web application where I have a normal login and now also the login for MS Entra ID.
When the user has logged in via MS Entra, and then logs out of the SaaS app, the user is not logged ...
1
vote
0
answers
16
views
VSCode not recognizing Magento paths in PHP file
VSCode is giving an "Undefined Type" error for the two \Magento\ paths. I installed two Magento extensions (Toolbox, Snippets) but it doesn't help. How do I get VSCode to recognize these ...
426
votes
22
answers
350k
views
Using str_replace so that it only acts on the first match?
I want a version of str_replace() that only replaces the first occurrence of $search in the $subject. Is there an easy solution to this, or do I need a hacky solution?