Public Questions for tag [php]

Ask Question

PHP is a well-known general-purpose useful scripting language that is particularly fit for web improvement. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

20 questions


0

Vote

1

Answers

99

View

I've got a little bit of a problem when I try to run this code. I receive this error:Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given inMy problem is in the while st

Mar 02

0

Vote

3

Answers

178

View

I had this working before :echo ini_get("memory_limit")."\n"; ini_set("memory_limit","256M"); echo ini_get("memory_limit")."\n";I checked the PHP documentation and googled it, and I did not find any

Nov 27

0

Vote

2

Answers

59

View

How to get the Laravel version and where is it defined?Is the Laravel version is defined inside my application directory or somewhere in the global server-side directory?The goal is to investigate, wh

0

Vote

3

Answers

62

View

I have an array like:$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); echo native_function($array, 0); // bar echo native_function($array, 1); // bin echo native_funct
php array 

Nov 27

0

Vote

3

Answers

76

View

In a form on a PHP page, you can use:In the action attribute of the form. Since echo $_SERVER['PHP_SELF'] does not pass variables for using GET and you have to use "", why would you use that or "#"?No
php form 

0

Vote

2

Answers

54

View

How to get the last indexed id or last inserted record id?how can I retrieve the last row and use it to insert it into the other table? I tried $mysqli->insert_id; then binding but it doesn't work.
php mysql 

Nov 27

0

Vote

4

Answers

689

View

I have a website in core PHP and I get error like thisWarning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string givenCode$query = "SELECT * FROM questions WHERE id='question' LIMIT
php mysql 

Nov 27

0

Vote

2

Answers

80

View

How can I detect which request type was used (GET, POST, PUT or DELETE) in PHP? I researched for this and find that I can do this with  $_SERVER  but I do not know how to use this.Pleas

Nov 27

0

Vote

2

Answers

53

View

How to use the time function in PHP language? Give me a different way of format and examples of time function.Which PHP function can return the current date/time?Thank You in advance

0

Vote

3

Answers

297

View

I have a custom PHP website for my blog system. I want to replace my all space from the user name with an underscore using PHP script.Please suggest to me the best way to replace spaces with underscor
php 

Nov 27

0

Vote

2

Answers

173

View

I have page one with the name (page1.php). I want to get data from page2.php in JSON.How I can do this on page2.php to return JSON.Another thing that could help me if answered, lately I've been retrie
php json 

Nov 27

0

Vote

2

Answers

588

View

I want to get a PHP class name without the use of namespace and without using reflection.namespace CRMPiccoBundle\Services\RFC\Webhook; class TicketCancelled extends Base implements Interface {
php oop class 

0

Vote

1

Answers

59

View

How to use Date and time functions in PHP?I want to find different formats for date and time using the date() function.Thank You

Nov 27

0

Vote

4

Answers

67

View

I want to return clean JSON from a PHP header script after page load. Do I have to set the Content-Type header or just echo result?

Nov 27

0

Vote

1

Answers

55

View

It appears pretty simple but I can not find a good method to do it. Say in the first page "page1.php" I created a variable$myVariable = "Some text";And the form's action for that page is "page2.php".

Nov 27

0

Vote

1

Answers

66

View

I have two types of array 1. Indexed arrays and 2. Associative Array. I need help to check key exists in an array or not.1. Indexed arrays$index_array = ['apple', 'pear', 'banana'];2. Associative Arra
php array 

Nov 26

0

Vote

3

Answers

79

View

I am making a website where I need to save the date in the PHP date() function.<?php $finalize_at = date('Y-m-d H:i:s'); ?>Is there any way to change the timezone for PHP or set a timezone c

0

Vote

1

Answers

77

View

I am working on a website and I want the user to upload files or images to the website. So I am finding a way to do that. I look into and it said that I needed to use the function move_uploaded_file()

Nov 26

0

Vote

1

Answers

70

View

I want to extract only text from a PHP string.I want to remove HTML tags, which is done by strip_tags. &nbsp; &amp; &copy; Please tell me any function which I can use to remove these

Nov 26

0

Vote

1

Answers

83

View

I have checked my PHP ini file (php.ini) and display_errors is set and also error reporting is E_ALL. I have restarted my Apache webserver.I have even put these lines at the top of my script, and

Nov 26