Most viewed questions in PHP

0 votes
0 answers

Decode base64 string - php

Is there any way to decode this ...READ MORE

Jul 22, 2022 in PHP by narikkadan
• 63,420 points
708 views
0 votes
1 answer

How to fix the session_register() deprecated issue?

Hello, Use $_SESSION directly to set variables. Like this: $_SESSION['name'] = 'stack'; Instead ...READ MORE

Nov 22, 2020 in PHP by Niroj
• 82,880 points
706 views
0 votes
0 answers

Strtotime() doesn't work with dd/mm/YYYY format

The strtotime() function user manual doesn't give ...READ MORE

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

How to add elements to an empty array in PHP?

I define an array in PHP : $cart ...READ MORE

Jun 3, 2022 in PHP by Kichu
• 19,050 points
701 views
0 votes
0 answers

PHP MySQLi num_rows Always Returns 0

In order to make database interaction simpler, ...READ MORE

Aug 7, 2022 in PHP by Kithuzzz
• 38,010 points
697 views
0 votes
0 answers

Find PHP version on windows command line

I wanted to know the version of ...READ MORE

Jun 14, 2022 in PHP by narikkadan
• 63,420 points
690 views
0 votes
0 answers

PHP Fatal error: Using $this when not in object context

I am working on a new WebApp without ...READ MORE

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

How can I connect to MySQL in Python 3 on Windows?

Hello @kartik, You should probably use pymysql - Pure Python ...READ MORE

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

How do I UPDATE from a SELECT in SQL Server?

Hello @kartik, In SQL Server, use MERGE MERGE INTO YourTable ...READ MORE

Jul 21, 2020 in PHP by Niroj
• 82,880 points
683 views
0 votes
0 answers

How to have SQL injection when using php function?

I'm having sql query as $login = mysql_real_escape_string(GetFromPost('login')); $password ...READ MORE

Sep 23, 2020 in PHP by Rohan
• 120 points
673 views
0 votes
1 answer

How to access array returned by a function in php?

Hello @kartik, Since PHP 5.4 it's possible to ...READ MORE

Nov 10, 2020 in PHP by anonymous
• 82,880 points
666 views
0 votes
0 answers

Laravel 5.4 Storage link

When I go to the link folder ...READ MORE

Jul 22, 2022 in PHP by Kithuzzz
• 38,010 points
665 views
0 votes
0 answers

Check if file exists in php

I have this code: if (!(file_exists(http://mysite.com/images/thumbnail_1286954822.jpg))) { ...READ MORE

Jun 4, 2022 in PHP by Kichu
• 19,050 points
665 views
0 votes
0 answers

How to check if a defined constant exists in PHP?

I am using fuelphp a PHP framework and I ...READ MORE

May 30, 2022 in PHP by Kichu
• 19,050 points
663 views
0 votes
0 answers

How to find array / dictionary value using key?

I want to use the key to ...READ MORE

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

How to extract and access data from JSON with PHP?

This is intended to be a general ...READ MORE

Jul 22, 2022 in PHP by narikkadan
• 63,420 points
652 views
0 votes
1 answer

Error: Premature end of script headers: backup.php

Hello @kartik< Try this settings on my apache.conf: <VirtualHost ...READ MORE

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

How to send HTTP response code?

Hello @kartik, you can use http_response_code() for get and set ...READ MORE

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

Show values from a MySQL database table inside a HTML table on a webpage

I am working on retrieving the values ...READ MORE

May 29, 2022 in PHP by Kichu
• 19,050 points
643 views
0 votes
0 answers

How to detect faulty JPEG in PHP? (Issue with SOFn, DQT or DHT JPEG marker missing before a JPEG SOS marker)

Is there a way to detect if ...READ MORE

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

Error:Internal server errordisplay in PHP via htaccess only

Hello @kartik,  Try adding this line .htaccess: php_flag display_startup_errors ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
641 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
632 views
0 votes
0 answers

MySQL fetch assoc VS mysql fetch array

These are the commonly used methods to ...READ MORE

Jun 27, 2022 in PHP by narikkadan
• 63,420 points
629 views
0 votes
0 answers

PHP | define() vs. const

In PHP, there are two ways to ...READ MORE

Jun 1, 2022 in PHP by Kichu
• 19,050 points
623 views
0 votes
0 answers

PHP - If variable is not empty, echo some html code

I want to display some HTML code ...READ MORE

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

How to Import SQL file into mysql?

Hello @kartik, From the mysql console: mysql> use DATABASE_NAME; mysql> ...READ MORE

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

Converting an integer to a string in PHP

Is it possible to change an integer ...READ MORE

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

How can to make a query with LIKE and get all results with mysqli ?

Hello @kartik, Here's how you properly fetch the ...READ MORE

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

How can I do an UPDATE statement with JOIN in SQL Server?

Hello @kartik, This should work in SQL Server: update ...READ MORE

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

How can you upload a file using PHP?

Hello, To upload a file by using PHP, ...READ MORE

Mar 27, 2020 in PHP by Niroj
• 82,880 points
610 views
0 votes
0 answers

500 Internal Server Error for php file not for html

There are barely 4-5 static pages on ...READ MORE

Jul 22, 2022 in PHP by narikkadan
• 63,420 points
608 views
0 votes
0 answers

PHP FILTER_VALIDATE_EMAIL does not work correctly

I employ PHP 5.3.10. Here is the ...READ MORE

Aug 4, 2022 in PHP by Kithuzzz
• 38,010 points
607 views
0 votes
0 answers

ErrorDocument 404 /404.php is not working in .htaccess file in PHP

This is the Content of my .htaccess file is: ErrorDocument ...READ MORE

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

How to get parameters from a URL string?

Hello @kartik, You can use the parse_url() and parse_str() for that. $parts = ...READ MORE

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

How does PHP 'foreach' actually work?

Let me start by stating that I ...READ MORE

Aug 7, 2022 in PHP by Kithuzzz
• 38,010 points
602 views
0 votes
0 answers

Can I dynamically create subdomains (PHP, .htaccess) with GoDaddy Hosting?

On my GoDaddy Hosting account, I'm attempting ...READ MORE

Aug 7, 2022 in PHP by Kithuzzz
• 38,010 points
596 views
0 votes
0 answers

Remove all html tags from php string

I want to display the first 110 ...READ MORE

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

How can I upload Multiple file in php?

Hello @kartik, Multiple files can be selected and ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
591 views
0 votes
0 answers

Convert to date format dd/mm/yyyy

I have the following date: 2010-04-19 18:31:27. I ...READ MORE

Jul 30, 2022 in PHP by Kithuzzz
• 38,010 points
590 views
0 votes
0 answers

Get last executed query in MySQL with PHP/CodeIgniter

In my_model.php, I have: $query1 = ( ...something... ); $query2 ...READ MORE

Jul 22, 2022 in PHP by Kithuzzz
• 38,010 points
589 views
0 votes
0 answers

Prevent nginx 504 Gateway timeout using PHP set_time_limit()

I am getting 504 timeout messages from ...READ MORE

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

How to get database structure in MySQL via query

Hello @kartik, Use this: DESCRIBE table; You can also use SHOW ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
583 views
0 votes
0 answers

Hot to display 😀😠as emoji to PHP

I stored emojis in my database and ...READ MORE

Jun 12, 2022 in PHP by narikkadan
• 63,420 points
582 views
0 votes
0 answers

Mail is not sending in php

My code to send mail from PHP: ...READ MORE

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

Catchable fatal error: Argument 1 passed to ClassA::method_a() must be an instance of ClassB, instance of ClassWrong given..

Hello @kartik, This is not a catchable fatal ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,880 points
579 views
0 votes
0 answers

indexOf and lastIndexOf in PHP?

In Java, we can use indexOf and ...READ MORE

Jun 27, 2022 in PHP by narikkadan
• 63,420 points
578 views
0 votes
0 answers

How to add php repositories to debian kali linux for php files?

I added: packages.sury.org/php through the script, I got on ...READ MORE

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

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

Hii, Here is an approach I have  used, it's ...READ MORE

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

How do I check whether a checkbox is checked in jQuery?

Hello @kartik, The checked property of a checkbox DOM element ...READ MORE

Aug 28, 2020 in PHP by Niroj
• 82,880 points
572 views
0 votes
0 answers

How to stop PHP code execution?

Is there a way to immediately stop PHP code ...READ MORE

Jul 23, 2022 in PHP by Kithuzzz
• 38,010 points
571 views