Latest questions in PHP

0 votes
1 answer

How to find the php.ini file from the command line?

Hello @kartik, You can get a full phpinfo() using : php ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
50,734 views
0 votes
1 answer

How to convert from MySQL datetime to another format with PHP?

Hello, To convert a date retrieved from MySQL ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
3,010 views
0 votes
1 answer

Error:Enabling error display in PHP via htaccess only?

Hello, To turn the actual display of errors ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
1,188 views
0 votes
1 answer

How to do error logging in CodeIgniter ?

Hello @kartik, CodeIgniter has some error logging functions ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
19,170 views
0 votes
1 answer

PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR

Hello @kartik, Change your syntax because it  was invalid. Updated syntax: $purchaseOrder = ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
4,857 views
0 votes
1 answer

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in .?

Hello @kartik, You may get this error because ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
2,092 views
0 votes
1 answer

Error:mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource

Hello, Error occurred here was due to the ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
1,035 views
0 votes
1 answer

How can I expire a PHP session after 50 minutes?

Hii @kartik, Use the session_set_cookie_params funciton to set the session. If necessary call this function ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
1,036 views
0 votes
1 answer

Error:Issue when trying to use IN() in wordpress database

Hello @kartik, Try this code : // Create an ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
845 views
0 votes
1 answer

ERROR: The file 'wp-config.php' already exists

Hello, Try to display the website first on ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
4,612 views
0 votes
1 answer

How to load Javascript in Wordpress Plugin?

Hello kartik, You need to specify when the ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
526 views
0 votes
1 answer

How do I get all posts from $wp_query in the search results in wordpress?

Hello @kartik, Set posts_per_page parameter in args to ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
6,028 views
0 votes
1 answer

Error: unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING

Hello @kartik, Make sure they are running Latest ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
6,213 views
0 votes
1 answer

Error:while importing Table for WORDPRESS

Hello @kartik, I had the same error when ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
1,556 views
0 votes
1 answer

Error:WP_Query() does not return all entries

Hello, Try adding posts_per_page=-1 to the string of parameters passed ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
859 views
0 votes
1 answer

How to get the current plugin directory in WordPress?

Hello @kartik, This will actually get the result ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
3,446 views
0 votes
1 answer

How to add custom javascript to WordPress Admin?

Hello, Use the admin_enqueue_scripts action and the wp_enqueue_script method to add custom ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
6,140 views
0 votes
1 answer

How can I add PHP page to WordPress?

Hii @kartik, First, duplicate post.php or page.php in your theme folder. Rename the ...READ MORE

May 8, 2020 in PHP by Niroj
• 82,880 points
1,121 views
0 votes
1 answer

How can we track Google Analytics on a redirection page with PHP?

Hello @kartik, Since the page that is sending ...READ MORE

Apr 29, 2020 in PHP by Niroj
• 82,880 points
813 views
0 votes
1 answer

How to query all the GraphQL type fields without writing a long query?

Hello @kartik, GraphQL query format was designed in order ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
1,341 views
0 votes
1 answer

How to detect search engine bots with php?

Hello, You can checkout if it's a search ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
1,191 views
0 votes
1 answer

error: Class 'PHPUnit_Framework_TestCase' not found in …?

Hello,  You can use TestCase instead PHPUnit_Framework_TestCase // use the following namespace use ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
4,157 views
0 votes
1 answer

Error:“Connection for controluser as defined in your configuration failed” with phpMyAdmin in XAMPP

Hii, I edited /etc/phpmyadmin/config.inc.php and changed the following ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
14,554 views
0 votes
1 answer

Why does the PHP json_encode function convert UTF-8 strings to hexadecimal entities?

Hii @kartik, Working with different servers with various ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
6,522 views
0 votes
1 answer

How to order results with findBy() in Doctrine

Hii @kartik, Try out this code $ens = $em->getRepository('AcmeBinBundle:Marks')               ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
9,303 views
0 votes
1 answer

How do I let PHP to create subdomain automatically for each user?

Hello @kartik, We setup wildcard DNS like they ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
5,174 views
0 votes
1 answer

How to Debug Variables like in PHP var_dump()?

Hello @kartik, Try out with the Smarty Session: {$smarty.session|@debug_print_var} or {$smarty.session|@print_r} To ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
1,217 views
0 votes
1 answer

How to resolve “must be an instance of string, string given” prior to PHP 7?

Hello, Prior to PHP 7 type hinting can only be ...READ MORE

Apr 20, 2020 in PHP by I Navin
• 220 points
4,594 views
0 votes
1 answer

How to set up file permissions for Laravel?

Hello @kartik, The permissions for the storage and vendor folders should stay ...READ MORE

Apr 20, 2020 in PHP by I Navin
• 220 points
3,977 views
0 votes
1 answer

How to clear APC cache entries?

Hello @kartik, You can use the PHP function ...READ MORE

Apr 15, 2020 in PHP by Niroj
• 82,880 points
1,087 views
0 votes
1 answer

How to implement a callback in PHP?

Hello, Implementation of a callback is done like ...READ MORE

Apr 15, 2020 in PHP by Niroj
• 82,880 points
676 views
0 votes
1 answer

Error:SSL certificate error: unable to get local issuer certificate

Hii, If you don't have access to php.ini, adding ...READ MORE

Apr 15, 2020 in PHP by Niroj
• 82,880 points
1,505 views
0 votes
1 answer

How to get current route in Symfony 2?

Hii,  The easiest way to do this: class MyController ...READ MORE

Apr 15, 2020 in PHP by Niroj
• 82,880 points
1,406 views
0 votes
1 answer

How to merge two arrays while keeping keys instead of reindexing?

Hello, Considering that you have $replaced = array('1' => ...READ MORE

Apr 15, 2020 in PHP by Niroj
• 82,880 points
2,467 views
0 votes
1 answer

What is the best way to allow plugins for a PHP application?

Hello @kartik, I've used, it's an attempt to ...READ MORE

Apr 15, 2020 in PHP by Niroj
• 82,880 points
524 views
0 votes
1 answer

I am trying to run following command But I end up with an error :

Hello Nishant, You are getting this error because your ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
515 views
0 votes
1 answer

How to include a PHP variable inside a MySQL statement?

Hii, You can try this: $query="SELECT * FROM CountryInfo ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
16,045 views
0 votes
1 answer

Error:Lost connection to MySQL server at 'reading initial communication packet', system?

Hello, You have to follow the below steps: bind-address ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
20,471 views
0 votes
1 answer

How to log in to phpMyAdmin with WAMP?

Hello @kartik,  Try-Username: root Password: (No password set). Sometimes it doesn't ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
6,389 views
0 votes
1 answer

How can I get ID of the last updated row in MySQL?

Hello @kartik, Suppose, item_id is an integer identity column in items table ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
11,471 views
0 votes
1 answer

What is the use of the @ symbol in PHP?

Hello @kartik, The @ symbol is the error control operator ("silence" or "shut-up" ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
11,449 views
0 votes
1 answer

SQL injection that gets around mysql_real_escape_string()?

Hello @kartik, Consider the following query: $iId = mysql_real_escape_string("1 ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
3,677 views
0 votes
0 answers

What are the differences in die() and exit() in PHP?

I think both have the same functionality, ...READ MORE

Apr 8, 2020 in PHP by kartik
• 37,510 points
565 views
0 votes
1 answer

How to get the client IP address in PHP ?

Hello, Here is a code sample of a good ...READ MORE

Apr 8, 2020 in PHP by Niroj
• 82,880 points
6,539 views
0 votes
1 answer

How to pass an array within a query string?

Hello, Submitting multi-value form fields, i.e. submitting arrays ...READ MORE

Apr 8, 2020 in PHP by Niroj
• 82,880 points
11,835 views
0 votes
2 answers

How to override trait function and call it from the overridden function?

instead of: return traitcalc($v); use this: ...READ MORE

Dec 13, 2020 in PHP by Uncle Nick
3,069 views
0 votes
1 answer

How to get xdebug var_dump to show full object/array?

Hello. These are configurable variables in php.ini: ; with ...READ MORE

Apr 7, 2020 in PHP by Niroj
• 82,880 points
3,199 views
0 votes
1 answer

How can I handle the warning of file_get_contents() function in PHP?

Hello @kartik, This is fairly simple: if (!$data = ...READ MORE

Apr 7, 2020 in PHP by Niroj
• 82,880 points
10,542 views
0 votes
1 answer

What does double question mark (??) operator mean in PHP?

Hello, It's the "null coalescing operator", added in ...READ MORE

Apr 2, 2020 in PHP by Niroj
• 82,880 points
7,115 views
0 votes
1 answer

Composer install error - requires ext_curl when it's actually enabled?

Hello, on php7 run for example: > sudo apt-get ...READ MORE

Apr 2, 2020 in PHP by Niroj
• 82,880 points
15,640 views