Most viewed questions in PHP

0 votes
1 answer

How do I remove a directory that is not empty?

Hello, Try this code: function rrmdir($dir) { if (is_dir($dir)) { ...READ MORE

Nov 4, 2020 in PHP by Niroj
• 82,880 points
3,678 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,637 views
0 votes
1 answer

How to check if a string contains a specific text using php?

Hello @kartik, Use the strpos function:  $haystack = "foo bar baz"; $needle ...READ MORE

Nov 10, 2020 in PHP by Niroj
• 82,880 points
3,605 views
0 votes
1 answer

How do I PHP-unserialize a jQuery-serialized form?

Hello @kartik, Provided that your server is receiving ...READ MORE

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

How to convert an image to base64 encoding?

Hello @kartik, You can also do this via ...READ MORE

Apr 1, 2020 in PHP by Niroj
• 82,880 points
3,553 views
0 votes
2 answers

Error:SMTP server response: 530 SMTP authentication is required.

Yes good i like it so nice ...READ MORE

Aug 25, 2020 in PHP by Mani Usman
3,552 views
0 votes
1 answer

How to check if a file exists from a url using php?

Hello, You have to use CURL function does_url_exists($url) { ...READ MORE

Nov 3, 2020 in PHP by Niroj
• 82,880 points
3,548 views
0 votes
1 answer

How to run process with realtime output in PHP?

Hello @kartik, This worked for me: $cmd = "ping ...READ MORE

Oct 20, 2020 in PHP by Niroj
• 82,880 points
3,514 views
0 votes
0 answers

How to run a PHP function due to a button click (with button 'data' passed)?

I manage some sortiment items on a ...READ MORE

May 28, 2022 in PHP by Kichu
• 19,050 points
3,507 views
0 votes
1 answer

How to save MySQL query output to excel or .txt file?

Hello @kartik, You can write following codes to ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
3,499 views
0 votes
0 answers

Uninstall php 7 in ubuntu 18.04

I have a server with a PHP ...READ MORE

Aug 2, 2022 in PHP by Kithuzzz
• 38,010 points
3,484 views
0 votes
1 answer

How to verify if $_GET exists?

You can use isset function: if(isset($_GET['id'])) { ...READ MORE

Oct 30, 2020 in PHP by Niroj
• 82,880 points
3,457 views
0 votes
1 answer

How to shrink Navigation menu or bar on Scroll?

Hey, You can follow the steps below in ...READ MORE

Feb 19, 2020 in PHP by varun
3,453 views
0 votes
1 answer

How to allow duplicate keys in php array?

Hello @kartik, You could have a single key ...READ MORE

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

Error:mysql_fetch_array() expects parameter 1 to be resource, boolean given

Hello @kartik, Error occurred here was due to ...READ MORE

Sep 16, 2020 in PHP by Niroj
• 82,880 points
3,444 views
0 votes
1 answer

How to GET URL parameter in PHP?

Hello @kartik, $_GET is not a function or language ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,880 points
3,443 views
0 votes
1 answer

How to delete from multiple tables in MySQL?

Hello @kartik, Use a JOIN in the DELETE statement. DELETE p, pa ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
3,419 views
0 votes
1 answer

What is a Cookie? How to create Cookies With PHP?

A cookie is often used to identify ...READ MORE

Feb 13, 2020 in PHP by Niroj
• 82,880 points
3,414 views
+1 vote
1 answer

Error:Ajax LARAVEL 419 POST error

Hello @kartik, Laravel 419 post error is usually ...READ MORE

Jun 16, 2020 in PHP by Niroj
• 82,880 points
3,401 views
0 votes
1 answer

Error:Sending Form file with form using AJAX

Hello @kartik, Don't pass the files into the ...READ MORE

Jun 16, 2020 in PHP by Niroj
• 82,880 points
3,390 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,390 views
0 votes
1 answer

How can I convert the output of PHP's filesize() function to a format with MegaBytes, KiloBytes etc?

Hello @kartik, Here is a sample: <?php // Snippet from ...READ MORE

Sep 15, 2020 in PHP by Niroj
• 82,880 points
3,363 views
0 votes
1 answer

How to enable PHP support in Netbeans?

Hello @kartik, Go to Tools->Plugins. In the Settings tab ensure that the ...READ MORE

Nov 5, 2020 in PHP by Niroj
• 82,880 points
3,358 views
0 votes
0 answers

Login using PHP and JavaScript from SQL database

I have developed a drop-down login panel using ...READ MORE

Jun 11, 2022 in PHP by narikkadan
• 63,420 points
3,356 views
0 votes
1 answer

How to comment out HTML and PHP together?

Hello @kartik, Instead of using HTML comments (which have ...READ MORE

Oct 6, 2020 in PHP by Niroj
• 82,880 points
3,355 views
0 votes
1 answer

How to install a specific version of package using Composer?

Hello, Just use php composer.phar require For example : php ...READ MORE

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

How do I use the json_encode() function with MySQL query results?

Hello @kartik, Use this: $sth = mysqli_query($conn, "SELECT ..."); $rows ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
3,336 views
0 votes
1 answer

How to get the home directory from a PHP CLI script?

Hello @kartik, You can fetch the value of ...READ MORE

Nov 3, 2020 in PHP by Niroj
• 82,880 points
3,333 views
0 votes
0 answers

This localhost page can’t be found :Phpmyadmin

I solved an issue with Apache and ...READ MORE

May 30, 2022 in PHP by Kichu
• 19,050 points
3,327 views
0 votes
1 answer

Error:Jquery .ajax method=“post” but $_POST empty

Hello @kartik, Instead of method: "post" you need to use type: ...READ MORE

Jun 16, 2020 in PHP by Niroj
• 82,880 points
3,300 views
0 votes
1 answer

PHP Error: Function name must be a string

Hello @kartik, It should be $_COOKIE['name'], not $_COOKIE('name') $_COOKIE is an array, ...READ MORE

Nov 4, 2020 in PHP by Niroj
• 82,880 points
3,295 views
0 votes
1 answer

What are the differences between mysqli_connect and mysqli_pconnect?

Hello, mysqli_pconnect() function is used for making a persistence ...READ MORE

Mar 27, 2020 in PHP by Niroj
• 82,880 points
3,294 views
0 votes
1 answer

How to execute a MySQL command from a shell script?

Hello @kartik, You need to use the -p flag to ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
3,277 views
0 votes
1 answer

How can I enable the MySQLi extension in PHP 7?

Hello @kartik, The problem is that the package ...READ MORE

Oct 30, 2020 in PHP by Niroj
• 82,880 points
3,265 views
0 votes
1 answer

How can I access Laravel .env variables in blade?

Hii @kartik, Try to implement this: @if (env('APP_ENV')!='Production') Enviroment Test @endif Hope ...READ MORE

Nov 10, 2020 in PHP by Niroj
• 82,880 points
3,197 views
0 votes
1 answer

How to Get $_POST from multiple checkboxes?

Hello @kartik, Set the name in the form ...READ MORE

Sep 15, 2020 in PHP by Niroj
• 82,880 points
3,184 views
0 votes
0 answers

Send mail using an email account created on Hostinger (PHP)

I am using an email I created ...READ MORE

Jun 7, 2022 in PHP by Kichu
• 19,050 points
3,178 views
0 votes
1 answer

How to check an IP address is within a range of two IPs in PHP?

Hello @kartik, With ip2long() it's easy to convert your addresses ...READ MORE

Nov 3, 2020 in PHP by Niroj
• 82,880 points
3,166 views
0 votes
1 answer

How to set time zone in codeigniter?

Hii, Add this line inside the main index.php of codeigniter ...READ MORE

Nov 6, 2020 in PHP by Niroj
• 82,880 points
3,164 views
0 votes
1 answer

How can I ping a server port with PHP?

Hello @kartik, Test different ports: $wait = 1; // ...READ MORE

Nov 19, 2020 in PHP by Niroj
• 82,880 points
3,158 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,139 views
0 votes
1 answer

How to check if a string is an email address in PHP?

Hello, Try this without regular expressions: <?php ...READ MORE

Nov 3, 2020 in PHP by Niroj
• 82,880 points
3,119 views
0 votes
1 answer

How to get WordPress post featured image URL?

Hello @kartik, Try this code below: <?php if (has_post_thumbnail( $post->ID ...READ MORE

Aug 14, 2020 in PHP by Niroj
• 82,880 points
3,118 views
0 votes
0 answers

PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused

I am trying to connect MySQL Database ...READ MORE

Jun 24, 2022 in PHP by narikkadan
• 63,420 points
3,098 views
0 votes
0 answers

PHP Passing ID in href

I want to have editable rows in ...READ MORE

May 27, 2022 in PHP by Kichu
• 19,050 points
3,090 views
0 votes
0 answers

Redirect users to different pages based on role php

Depending on the responsibilities that have been ...READ MORE

Jul 21, 2022 in PHP by narikkadan
• 63,420 points
3,041 views
0 votes
1 answer

How to display errors for my MySQLi query?

Hii, Use mysqli_error() As in: $sql = "Your SQL statement ...READ MORE

Nov 9, 2020 in PHP by Niroj
• 82,880 points
3,028 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,023 views
0 votes
1 answer

Fatal error: Call to undefined function mysql_connect()

Hello @kartik, You upgraded to PHP 7, and ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
3,014 views
0 votes
1 answer

How can I loop through all the properties of object using php?

Hello @kartik, If this is just for debugging ...READ MORE

Nov 10, 2020 in PHP by Niroj
• 82,880 points
2,985 views