Most viewed questions in PHP

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
3,092 views
0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

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

How to create virtual column using MySQL SELECT?

Hello, Something like: SELECT id, email, IF(active = 1, ...READ MORE

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

How to echo a MySQLi prepared statement?

Hello @kartik, I don't think you can - ...READ MORE

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

How to prevent direct access to a php include file?

Hello @kartik, Add this to the page that ...READ MORE

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

How can you display the error messages?

Hey, In the HTML form, we add ...READ MORE

Feb 13, 2020 in PHP by Niroj
• 82,880 points
3,038 views
0 votes
1 answer

How to change public folder to public_html in laravel 5?

Hello @kartik, go to this address : /app/Providers/AppServiceProvider.php and append ...READ MORE

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

What is meant by passing the variable by value and reference in PHP?

Hello, When the variable is passed as value ...READ MORE

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

How to Validate Form Data With PHP?

Hey @kartik, The first thing we will do ...READ MORE

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

How to Get the full URL in PHP?

Hello @kartik, Have a look at $_SERVER['REQUEST_URI'], i.e. $actual_link = ...READ MORE

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

How to properly URL encode a string in PHP?

Hello @kartik, For the URI query use urlencode/urldecode; for ...READ MORE

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

PHPMailer: SMTP Error: Could not connect to SMTP host

I am having trouble sending mail through ...READ MORE

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

What is the use of $_REQUEST variable in php?

Hii @kartik, The $_REQUEST variable is used to read the ...READ MORE

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

How I can make a query with MySQL that checks if the valuein a certain column contains certain data?

Hello @kartik, Try this query: mysql_query(" SELECT * FROM `table` WHERE `column` ...READ MORE

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

How to access class constants in Twig?

Hello @kartik, Try this: {% if var == constant('Namespace\\Entity::TYPE_PERSON') ...READ MORE

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

PHPMyAdmin Default login password

I installed  Fedora 14 and installed the ...READ MORE

Jun 25, 2022 in PHP by narikkadan
• 63,700 points
2,866 views
0 votes
0 answers

How to compile PHP code and upload a binary-ish file, which will just be run by the byte code interpreter?

PHP is compiled to byte code before ...READ MORE

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

How to matching an IP to a CIDR mask in PHP 5?

Hello @kartik, If only using IPv4: use ip2long() to convert the ...READ MORE

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

How to concatenate text from multiple rows into a single text string in SQL server?

Hello @kartik, Use COALESCE: DECLARE @Names VARCHAR(8000) SELECT @Names = ...READ MORE

Jul 21, 2020 in PHP by Niroj
• 82,880 points
2,846 views
0 votes
1 answer

How to pass arguments to an included file?

Hello @kartik, Include has the scope of the ...READ MORE

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

Error: Warning: Illegal string offset 'host' in ....

Hello @kartik,  Try this way: $memcachedConfig = array("host" => ...READ MORE

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

How to fetch specific data from MySQL database to my PHP table?

I want to get data from the ...READ MORE

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

How to load return array from a PHP file?

Hii @kartik, When an included file returns something, ...READ MORE

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

Remove Image background with php and save transparent png

I am working on functionality that removes the ...READ MORE

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

How to check not in array element

I want to check if an element is ...READ MORE

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

How to convert PHP code to MySQL query to CSV?

Hello @kartik, Try this: SELECT * INTO OUTFILE "c:/mydata.csv" FIELDS ...READ MORE

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

What are the vulnerability related to PHP Form?

Hii, The $_SERVER["PHP_SELF"] variable can be used by ...READ MORE

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

How PHP Replace last occurrence of a String in a String?

Hello @kartik, You can use this function: function str_lreplace($search, ...READ MORE

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

How to get current PHP page name?

Hello @kartik, You can use basename() and $_SERVER['PHP_SELF'] to get current page ...READ MORE

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

How do I send a POST request with PHP?

Hello @kartik, CURL-less method with PHP5: $url = 'http://server.com/path'; $data ...READ MORE

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

php error: The Encrypt library requires the Mcrypt extension in codeigniter

I have a  login and sign-up form and ...READ MORE

Jun 20, 2022 in PHP by Kithuzzz
• 38,010 points
2,747 views
0 votes
1 answer

How to route GET and POST for same pattern in Laravel?

Hello @kartik, You could try the following: Route::controller('login','AuthController'); Then in ...READ MORE

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

How to get the request parameters in symfony2

Hello @kartik, The naming is not all that ...READ MORE

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

How to return an array from an AJAX call?

Hello, Php has a function for this, just ...READ MORE

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

How to change php version in htaccess in server?

Hello, To switch to PHP 4.4: AddHandler application/x-httpd-php4 .php To ...READ MORE

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

How to remove html special chars?

Hello, Either decode them using html_entity_decode or remove them using preg_replace: $Content ...READ MORE

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

How can I use Sockets.io on the client side and communicate with a PHP based application on the server?

Hello @kartik, For 'long-lived connection' , you can ...READ MORE

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

How To Execute SSH Commands Via PHP

Use phpseclib, a pure PHP, SSH implementation. An example: <?php include('Net/SSH2.php'); $ssh ...READ MORE

Oct 30, 2020 in PHP by Niroj
• 82,880 points
2,720 views
0 votes
0 answers

How to open a file named index.php which is in htdocs/project1 folder in xampp?

I have a folder named project1 in ...READ MORE

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

How to check if row is soft-deleted in Eloquent?

Hello, Try this: if ($thing->trashed()) { ... } READ MORE

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

Notice: Undefined index: bid in C:\xampp\htdocs\userac\courier_management_system-master\courier_management_system-master\addstaff.php on line 130

Hello @saima , Before you extract values from $_POST ,$_SESSION, ...READ MORE

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

How to access mysql result set data with a foreach loop

I'm working on a PHP application that ...READ MORE

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

Fatal error: Class 'SoapClient' not found in C:\Program Files (x86)\EasyPHP-5.3.9\www\server.php on line 2

Hello @kartik, To install SOAP in PHP-7 run ...READ MORE

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

How To Run PHP From Windows Command Line in WAMPServer

Hello @kartik, Try using batch file Open notepad type php -S ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,880 points
2,616 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,613 views
0 votes
1 answer

How do I find the mime-type of a file with php?

Hello @kartik, mime_content_type() is deprecated, so you won't ...READ MORE

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

How to generate .json file with PHP?

Hello @kartik, Here is a sample code: <?php $sql="select ...READ MORE

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

How to enable mysqlnd for php?

Hello, The ./configure command is part of the compilation process ...READ MORE

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

How to remove duplicate values from an array in PHP?

Hello @kartik, Use array_unique(): Example: $array = array(1, 2, 2, 3); $array ...READ MORE

Sep 15, 2020 in PHP by Niroj
• 82,880 points
2,551 views