PHP - best way to bring array up one level

PHP
I have this nested array: Array ( [0] => Array ( [0] => Array ( [name] => Adam S...
2 years ago

MySQL Multiple Conditions

PHP
I am trying to search my database, I initially had it working with only one and condition but now with four, it will just refresh the page, removing f...
2 years ago

How i can get username? (relation db)

PHP
Controller: getting posts public function actionIndex() { $posts = Post::find(); $pagination = new Pagination([ 'defaultPageSize' ...
2 years ago

How to find index of object in php array?

PHP
Here is print_r output of my array: Array ( [0] => stdClass Object ( [itemId] => 560639000019 [name] => Item no1 ...
2 years ago

How to extract price from given url using Xpath?

PHP
From a given url I want to extract some detail from it like title, price. for title it works fine with this code <?php $getURL = file_get_cont...
2 years ago

Using an array of users with update_user_meta

PHP
I currently have the following code which updates the current user logged in: $current_user = wp_get_current_user(); update_user_meta($current_user-&...
2 years ago

PHP - JSON saved in a wrong format when unset a value

PHP
I have an array of videos Ids and when a user clicks on a button the videoId of the clicked video appends to the array. When the user clicks again on...
2 years ago

PHP Find same values in Array and create new array

PHP
I have an array like this: array 0 => array (size=5) 'id' => string '1' (length=1) 'hostings_id' => string '4' (length=1...
2 years ago

Curl isn't woking with Nagios

PHP
I'm currently developing a nagios plugin with PHP and cURL. My problem is that my script is working well when i use it with PHP like this : #php /u...
2 years ago

php arrange checkbox values in two columns

PHP
I have a form with checkboxes and I want to arrange the checkboxes in two columns instead of one single long column. How can i split it to two column...
2 years ago

Model id is overridden by related model

PHP
I have an Eloquent model that has a scope method to filter some rows: class TODocs extends \Eloquent { public function scopeUnexported($query) ...
2 years ago

Codeception run test from web interface

PHP
I need to run codeception's test from web interface. Have no idea how to do it and cant search it in google. Or it work for console only?
2 years ago

Finding IP of a website that referring to my PHP script

PHP
I was creating a PHP file that generates a JavaScript code. In case a website reefers to my code: <script src="http://myserver.com/myJS.php">...
2 years ago

How do I suppress this foreach warning when the function that contains it relies on $_POST data

PHP
I have the following code which functions as intended when $_POST values are set, however, if no $POST values(IE when the page is first loaded) are se...
2 years ago

Displaying url in php search box

PHP
I am trying to make this search page to display the URL's below the search bar instead of the actual name of the "product". Here is how far I've gone ...
2 years ago

Using global variable in my class causing unexpected syntax

PHP
I have a class that requires a variable that is defined out of the scope of it. So i tried using global but, this causes this error: syntax error,...
2 years ago

How to display tables by school year and semester using php?

PHP
I am trying to display a table by school year using PHP. I it seems not working very well because the school year displays redundantly. How to simply...
2 years ago

Laravel 5 how to get route action name?

PHP
I'm trying to get the current route action, but I'm not sure how to go about it. In Laravel 4 I was using Route::currentRouteAction() but now it's a b...
2 years ago

MySQL statement takes more than minute to excute

PHP
I am working on a website in which the database is huge. 1 million records are in the table at the time. When I perform a query then it takes too much...
2 years ago

Warning: Missing 1 argument

PHP
Any idea why I get this error: Warning: Missing argument 1 for person::__construct(), called in /home/fishbein/public_html/dev/OOP/index.php on line ...
2 years ago