Python was released in 1991 and created by Guido van Rossum. Php was released in 1994 and created by Rasmus Lerdorf.
Now let me discuss about comparison between python and PHP.
Python vs Php
Syntax of Python is like the English language and is easy to read. Reading code in PHP is a little bit difficult due to the naming convention used.
Python is easy to manage while PHP is difficult to manage.
Python is easy and is best for long term projects. PHP is also easy to learn.
Python is used in machine learning, artificial intelligence, automation tasks, and data science. Php is mostly used for web development.
Which is popular
For last few years python popularity is increasing as compared to PHP.
Python has costly web hosting while PHP websites has low cost web hosting.
Python is more secure while PHP is less secured.
The salary of python developers in the U.S is approx. $122k per year while PHP developer salary in the U.S is approx. $63k per year.
Python has increased in community support than before. Php has wider community support.
Python is dynamic in nature, rapidly deployed, and uses less code. Php is open source and is easily deployed.
Python has few frameworks including Django, Flask. Php has many frameworks including Codeignitor, Laravel, and Slim.
Which company using
Python is used by Google, Instagram, Uber, Mozilla, Pinterest. Php is used by Viber, Facebook, WordPress, Hootsuite, Appcelerator
Python is a general-purpose language while PHP is only made for web development.
If you have more time to learn then I suggest you learn both Python and PHP. Python has more job demands than PHP. If you want to work only in web development then I suggest you go for PHP. Python is not good at web development. It is good if you also learn front end development whether you choose python or PHP.