69 Answered Questions for the topic PHP


I want to create App

Hello Sir and Madam I purchased and modified A PhP ( Laravel Scripts) .I wan to Create app of that Please Help me.I Created Frontend Of App in Flutter But I don't Know How to Connect My PHP Script... more

Can you help me find a topic

I need to make a program in php language, but I could not find what to write a topic or any php code written, can it help you in advance.


Which exact tecnology to use for a web with mobile apps realtime project?

We were planning to develop a realtime project in which features like call, chat, and video calls are there between customers and vendors and charged per minute from customers as per call/chat rate... more


Which Game Servers Hosting Control Panel is the best?

Which back-end web programming language to use?

I have a project where I will be collaborating to build a fairly simple site with some database access. I will be doing the back-end work, and my colleague will be doing the web design. The problem... more


How can I team up two MVC frameworks without having them fight each other?

I'm creating a CRUD-based web project, and am thinking about using a server side MVC framework (such as CodeIgniter or Laravel) in tandem with a client side MVC framework (such as AngularJS). Is... more

PHP: when to use arrays, and when to use objects for mostly-data-storing code constructs?

PHP is a mixed paradigm language, allowing to use and return non-object data types, such as arrays. I pose a question to try to clarify some guidelines for selection of arrays vs objects when... more

Is dynamic language always interpreted?

Looking at most (if not all) dynamic languages [i.e Python, PHP, Perl and Ruby], they are all interpreted. Correct me if I'm wrong. Is there any example of dynamic language that goes through... more
Php Mysql Json


php api json customization

I want build my own api using php like this https://opentdb.com/api.php?amount=5&category=9and Please check :1. amount=$amount2. catagory=$catagory
Php Logic


What should be passed into if() to print 'Hello World'?

What should be passed into the if() to print the output as "Hello World"? [Note: It should execute the else block.] if(?){ } else { echo "World"; }

unusual ternary operation?

I was asked to perform this operation of ternary operator use: $test='one'; echo $test == 'one' ? 'one' : $test == 'two' ? 'two' : 'three'; Which prints two (checked using php). I am still... more

Type-juggling and (strict) greater/lesser-than comparisons in PHP?

PHP is famous for its type-juggling. I must admit it puzzles me, and I'm having a hard time to find out basic logical/fundamental things in comparisons. For example: If `$a > $b` is true and... more


Where is my php.ini file located on the server?

A few years ago I installed Apache 2.2x and PHP 5.3.1 on a Linux server I maintain. I used .tar.gz's and built them as instructed (instead of rpms and what-have-you). And all was fine. Today I... more


What is the difference between public, private, and protected in PHP?

When and why should I use `public`, `private`, and `protected` functions and variables inside a class? What is the difference between them? Examples: // Public public $variable; public... more


Show a number to 2 decimal places?

What's the correct way to round a PHP string to 2 decimal places? $number = "520"; // It's a string from a DB $formatted_number = round_to_2dp($number); echo $formatted_number; The... more


PHPDoc type hinting for array of objects?

So, in PHPDoc one can specify `@var` above the member variable declaration to hint at its type. Then an IDE, for ex. PHPEd, will know what type of object it's working with and will be able to... more


How can I parse a JSON file with PHP?

I tried to parse a JSON file using PHP. But I am stuck now. This is the content of my JSON file: { "John": { "status":"Wait" }, "Jennifer": { "status":"Active" }, ... more


How to determine the first and last iteration in a foreach loop?

The question is simple. I have a `foreach` loop in my code: foreach($array as $element) { //code } In this loop, I want to react differently when we are in first or last iteration. How... more


Is there a function to make a copy of a PHP array to another?

Is there a function to make a copy of a PHP array to another? I have been burned a few times trying to copy PHP arrays. I want to copy an array defined inside an object to a global outside it.


how to get the last char of a string in PHP?

I need to get the last character of a string. Say I have "testers" as input string and I want the result to be "s". how can I do that in PHP?


How to get useful error messages in PHP?

I find programming in PHP quite frustrating. Quite often I will try and run the script and just get a blank screen back. No error message, just empty screen. The cause might have been a simple... more


How to find the foreach index?

Is it possible to find the `foreach` index? in a `for` loop as follows: for ($i = 0; $i < 10; ++$i) { echo $i . ' '; } `$i` will give you the index. Do I have to use the `for` loop... more


Insert new item in array on any position in PHP?

How can I insert a new item into an array on any position, for example in the middle of array?


How to parse a string of boolean logic in PHP?

I'm building a PHP class with a private member function that returns a string value such as: 'true && true || false' to a public member function. (This string is the result of some regex... more


What is thread safe or non-thread safe in PHP?

I saw different binaries for PHP, like non-thread or thread safe? What does this mean? What is the difference between these packages?

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.