PHP - call to member function on null

PHP
I have the following three classes: class Dom_Form_Section extends Dom { /* ... code ommited ... */ public function addElem($Elem) { if (...
3 years ago

How do i change text inside a button with if-else statement?

PHP
Im on a dynamic webpage written in php and would like to have an if else statement that would look inside mysql database table and check if the strin...
3 years ago

Use of PHP Magic Methods __sleep and __wakeup

PHP
What is the use of the __sleep and __wakeup magic methods in PHP? I read the PHP documentation but it's still not clear: class sleepWakeup { pub...
3 years ago

Set default_socket_timeout to infinity?

PHP
I know that in /etc/php5/fpm/php.ini there is a setting called default_socket_timeout which in practice terminates connections that have not had a res...
3 years ago

PHPUnit print tests execution time

PHP
is there a way to print the execution time of each test with PHPUnit?
3 years ago

password_verify() not verifying hashed password

PHP
I'm trying to has a password in PHP using password_hash and password_verify. I am correctly hashing the password as it is being into the database hash...
3 years ago

PHP + MySQL transactions examples

PHP
I really haven't found normal example of PHP file where MySQL transactions are being used. Can you show me simple example of that? And one more ques...
3 years ago

How can I get product count in each category like WooCommerce back-end?

PHP
I am building a new site and I am pretty comfortable with Woocommerce. I just need a quick trick to get the product count in each category. I'm alread...
3 years ago

Append data to Json from PHP

PHP
I want to append { "pname":"superman" , "pid":"4" }to the obdatabase.json. But my attempt below completely overwrite the json file. How do I modify th...
3 years ago

Page Scrolling Effect With Ajax How Data Is Loaded Into The Page

PHP
I am loading data from a mysql table into a html table. I am using AJAX php Jquery to accomplish this. I need to make sure that the way I built this w...
3 years ago

Cross multiply text in PHP

PHP
I have two excel sheets- First Sheet Columns: ColA ColB ColC ColD ColE (containing M rows) ~700 rows A B C D E AA BB CC ...
3 years ago

How to store HDFC payment gateway response data value in database

PHP
Hello I am implementing HDFC new payment gateway in php. All things working well. But in response i am getting datastring like: txn_status=0300|tx...
3 years ago

checking existing username is not working

PHP
im at lost here. pls help. tqvm. theres no problem with registering but it still add even when the username already exist. tq again. 1.register.php ...
3 years ago

PHP AES encrypt / decrypt

PHP
I found an example for en/decoding strings in PHP. At first it looks very good but it wont work :-( Does anyone know what the problem is? $Pass = "P...
3 years ago

Put image in lower left corner of another image

PHP
So, I've got this code that puts an image in the right lowermost point of an image. Now I would like to do that exactly, but in the left lowermost co...
3 years ago

How to get a list of similar items PHP

PHP
I have 4 tables: items +----+------+---------+-----+ | id | name | city_id | ... | +----+------+---------+-----+ attributes +----+------+-----+ |...
3 years ago

Get the first element of an array

PHP
I have an array: array( 4 => 'apple', 7 => 'orange', 13 => 'plum' ) I would like to get the first element of this array. Expected result:...
3 years ago

ReflectionException in Route.php line

PHP
<?php class Myform extends Controller { public function index() { return view('form'); } } ?> the code of routes Route:...
3 years ago

How to use async Mysql query with PHP PDO

PHP
The Mysqlnd driver PHP 5.6 have opportunity to use a Async queries http://php.net/manual/en/mysqli.reap-async-query.php How to use Async queries wi...
3 years ago

how to upload multiple images to mysql db using php

PHP
i am making an ecommerce site, i want to upload multiple images that can be used to show the products. my problem is that it only uploads one image wh...
3 years ago