Most viewed questions in PHP

0 votes
1 answer

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

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

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

How to display HTML tags as plain text ?

Hello @kartik, Replace < with &lt; and& ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,880 points
2,495 views
0 votes
0 answers

PHP header(Location: ...): Force URL change in address bar

I have a new webpage but the ...READ MORE

Jun 1, 2022 in PHP by Kichu
• 19,050 points
2,477 views
0 votes
1 answer

How to enable curl in xampp?

Hello @kartik, You have to modify the php.ini ...READ MORE

Oct 29, 2020 in PHP by Niroj
• 82,880 points
2,476 views
0 votes
1 answer

How can I create XAMPP/Apache serve file outside of htdocs?

Hello @kartik, You can relocate it by editing ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
2,470 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,457 views
0 votes
1 answer

How to move columns in a MySQL table?

Hello @kartik, If empName is a VARCHAR(50) column: ALTER ...READ MORE

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

How to alter a MySQL column to be AUTO_INCREMENT?

Hello @kartik, Try this: ALTER TABLE document MODIFY COLUMN ...READ MORE

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

How to get request string without GET arguments?

Hello @kartik, You can use $_SERVER['REQUEST_URI'] to get requested path. ...READ MORE

Nov 14, 2020 in PHP by Niroj
• 82,880 points
2,435 views
0 votes
1 answer

How to get the http headers from current request in PHP?

Hello, Try this code: if (!function_exists('getallheaders')) { ...READ MORE

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

Error: Class'Illuminate\Foundation\Application' not found

Hii, Use the --no-scripts flag to prevent artisan from executing ...READ MORE

Nov 13, 2020 in PHP by Niroj
• 82,880 points
2,418 views
0 votes
1 answer

How to add a line break within echo in PHP?

Hello @kartik, You have to use br when ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,880 points
2,407 views
0 votes
1 answer

How can I get enum possible values in a MySQL database?

Hello @kartik, I have a codeigniter version for ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,880 points
2,400 views
0 votes
1 answer

How do you create a .gz file using PHP?

Hello @kartik, This code does the trick // Name ...READ MORE

Nov 6, 2020 in PHP by Niroj
• 82,880 points
2,346 views
0 votes
0 answers

MySQL error - #1932 - Table 'phpmyadmin.pma user config' doesn't exist in engine

I am working on creating a database ...READ MORE

Jun 23, 2022 in PHP by narikkadan
• 63,420 points
2,344 views
+1 vote
2 answers

How to make asynchronous HTTP requests in PHP?

Hello @kartik, Use this code: function post_without_wait($url, $params) { ...READ MORE

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

How can we avoid my php form from hacking?

Hii @kartik, If you want to know php ...READ MORE

Feb 13, 2020 in PHP by Niroj
• 82,880 points
2,312 views
0 votes
0 answers

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

I'm running into a small issue with ...READ MORE

Aug 1, 2022 in PHP by Kithuzzz
• 38,010 points
2,279 views
0 votes
0 answers

Convert stdClass object to array in PHP

I fetched post_id from postmeta: $post_id = $wpdb->get_results("SELECT ...READ MORE

Jun 27, 2022 in PHP by narikkadan
• 63,420 points
2,258 views
0 votes
1 answer

How to export the MySql database structure without the data just the structure?

Hello @kartik, You can do with the --no-data option with ...READ MORE

Aug 18, 2020 in PHP by Niroj
• 82,880 points
2,258 views
0 votes
1 answer

How to convert a string to date in mysql?

Hello @kartik, you can do SELECT STR_TO_DATE(yourdatefield, '%m/%d/%Y') FROM ...READ MORE

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

If isset $_POST

I have a form on one page ...READ MORE

May 28, 2022 in PHP by Kichu
• 19,050 points
2,221 views
0 votes
0 answers

Does the string "php?id=1" within a http GET request mean there is necesseraly an sql request to a back-end database?

You can use Google dorks like "inurl:.php?id=" ...READ MORE

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

PHP __PHP_Incomplete_Class Object with my $_SESSION data

Hello @kartik, You just have to include the safestring.class.php before ...READ MORE

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

How to get all columns' names for all the tables in MySQL?

Hello @kartik, Try this: select * from information_schema.columns where table_schema ...READ MORE

Aug 19, 2020 in PHP by Niroj
• 82,880 points
2,138 views
0 votes
0 answers

phpmailer error "Could not instantiate mail function"

I'm getting the error "Mailer Error: Could ...READ MORE

Jun 13, 2022 in PHP by narikkadan
• 63,420 points
2,127 views
0 votes
1 answer

How to output MySQL query results in CSV format?

Hello @kartik, Using this command columns names will ...READ MORE

Aug 18, 2020 in PHP by Niroj
• 82,880 points
2,127 views
0 votes
1 answer

How do I resize pngs with transparency in PHP?

Hello @kartik, you need to set the blending ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
2,124 views
0 votes
0 answers

Parse error: Syntax error, unexpected end of file in my PHP code

I am getting this error: Parse error: syntax ...READ MORE

Jun 10, 2022 in PHP by narikkadan
• 63,420 points
2,114 views
0 votes
1 answer

How to get the location from an IP address?

Hello @kartik, You could download a free GeoIP ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,880 points
2,107 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,085 views
0 votes
0 answers

Cannot access to localhost/xampp/index.php

When I type localhost in my browser ...READ MORE

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

How to validate E-mail and URL of Php form?

hey, The code below shows a simple way ...READ MORE

Feb 13, 2020 in PHP by manish
2,033 views
0 votes
0 answers

PHP form - Registration Successful Message on New Page

After each entry has been verified, the ...READ MORE

Jul 24, 2022 in PHP by Kithuzzz
• 38,010 points
2,028 views
0 votes
1 answer

Error:preg_match() [function.preg-match]: Unknown modifier '+' in raptr.php on line 14

Hello, Try this code: preg_match('/[a-zA-Z]+<\/a>.$/', $lastgame, $match); print_r($match); Using / as a delimiter ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
2,009 views
0 votes
0 answers

How to set php executable path php.validate.executablePath in vscode when php is set inside docker container?

I have a development environment based on ...READ MORE

Jun 18, 2022 in PHP by narikkadan
• 63,420 points
1,994 views
0 votes
0 answers

Uploading multiple image files to php mysql gallery

I am close to 65% close to ...READ MORE

Jun 27, 2022 in PHP by narikkadan
• 63,420 points
1,990 views
0 votes
1 answer

How do I remove http, https and slash from user input in php

Hello @kartik, Use: $url = preg_replace("(^https?://)", "", $url ); This ...READ MORE

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

How to disable registration new users in Laravel?

Hello @kartik, Laravel 5.7 introduced the following functionality: Auth::routes(['register' ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
1,949 views
0 votes
1 answer

How do I get the last inserted ID of a MySQL table in PHP?

Hello @kartik, If you're using PDO, use PDO::lastInsertId. If you're ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,880 points
1,948 views
0 votes
1 answer

How to store IP in database using php?

Hello @kartik, Store the ip as a INT(11) UNSIGNED, ...READ MORE

Nov 13, 2020 in PHP by Niroj
• 82,880 points
1,933 views
0 votes
0 answers

Login To Facebook Using PHP cURL

I'm trying to use cURL to log ...READ MORE

Aug 6, 2022 in PHP by Kithuzzz
• 38,010 points
1,896 views
0 votes
0 answers

PHP is not recognized as an internal or external command in command prompt

I am getting this error when I ...READ MORE

May 7, 2022 in PHP by narikkadan
• 63,420 points
1,887 views
0 votes
1 answer

Error:MySQL Update Inner Join tables query

Hello @kartik, Try this: UPDATE business AS b INNER JOIN ...READ MORE

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

How to embed a .png image into an html page?

Hello @kartik, Try this: div.image { width:100px; ...READ MORE

Nov 16, 2020 in PHP by Niroj
• 82,880 points
1,877 views
0 votes
0 answers

Multiple ways of calling parent method in PHP

I wasn't sure why both methods calls ...READ MORE

Jul 23, 2022 in PHP by Kithuzzz
• 38,010 points
1,869 views
0 votes
1 answer

How to Convert timestamp to readable date/time PHP?

Hello @kartik, Use PHP's date() function. Example: echo date('m/d/Y', 1299446702); Hope it helps!! Thank ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
1,859 views
0 votes
0 answers

How to reverse an array in php WITHOUT using the array reverse method

I have an array called reverse array ...READ MORE

Jun 12, 2022 in PHP by narikkadan
• 63,420 points
1,854 views
0 votes
1 answer

How to get the list of specific files in a directory using php?

Hello @kartik, You'll be wanting to use glob() Example: $files = ...READ MORE

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

How to remove GET-variables with PHP?

Hello @kartik, Try this: preg_replace('/\\?.*/', '', $str) Hope ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,880 points
1,847 views