50 Answered Questions for the topic PHP

07/29/19

#### 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

07/29/19

#### 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

07/29/19

#### 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

07/29/19

#### 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

06/19/19

#### 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"; }

06/19/19

06/05/19

#### 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

06/05/19

#### 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

06/04/19

#### 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

06/03/19

#### 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.

06/02/19

#### 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?

06/01/19

#### 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

05/29/19

#### 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?

05/29/19

#### 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

05/29/19

#### How to perform an action every 5 results?

How can I perform an action within a for loop every 5 results? Basically I'm just trying to emulate a table with 5 columns.

05/28/19

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

05/28/19

1

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

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

#### OR

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