CodeClerks

What are the differences between Python and PHP?



Write the reason you're deleting this FAQ

What are the differences between Python and PHP?

It's very common to convert from Python to PHP, but many new Python users struggle to reconcile the differences. Please talk about the ways that Python is different or better than PHP and some common situations a new Python user might face.

Comments

Please login or sign up to leave a comment

Join
Jadster
I think that Python and PHP are in a way similar but they also have their major differences. Python and PHP can both be used for many different things entirely and just how the codes run are different entirely. You can make a calculator with Python easily but making one with PHP may prove to be more of a challenge.



Are you sure you want to delete this post?

jakemadness
They are quit similar check out the loops in both languages for a rough idea.

Python loop

array = ['one', 'two', 'three']
for value in array:
#{
  print value
#}
 


and a PHP loop

$array = ['one', 'two', 'three'];
foreach ($array as $value)
{
   print $value;
}
 

I always comment out the brackets in Python because I am more familiar with PHP.



Are you sure you want to delete this post?