Learning PHP

Where can one learn to program with PHP quickly? I understand that you need this to write some scripts for USSD… And will PRSPs provide the environment to write the USSD programmes? Or to simulate the code?

Ingia site ya Africa’s talking

To understand the basics and familiarize yourself with the syntax, begin here: PHP Tutorial

Regarding PRSPs providing an environment, I’m not certain therefore can’t provide a definite answer.

Asante. Let me check it up.

I have seen that they recommend learning PHP but not too sure where one can learn fast… very fast… am not a greenhorn as such but I have not programmed for a long time now…

From what I understand, you will be dealing with an API, most probably a REST API, which serves data in Json. Therefore, just learn the API endpoints and consume it using the language you are already familiar with. And if you are looking to learn a Language, I would recommend Python over PHP, you can do more with it.

Use sololearn for quick learning

Thank you… let me see where I can learn this because I need to see how to link up with M-Pesa in the USSD session…

Let me search online for it

On it… Interesting that one can combine Strings and Integers… Most of the data types can be used in combination with one another. In this example, string and integer are put together to determine the sum of two numbers. This would cause serious problems on “C” or "C++)…

For learning: There are many options/sites:

[ol]
[li]W3Schools[/li][li]Code academy[/li][li]Tutorials point[/li][/ol]
For environments, note one thing: If the PRSP in question has their own SMS APIs, then by working with their APIs you’ll have access to a sandbox environment to test/stage your code. Otherwise, if you’re working with other 3rd party APIs, then you’ll have to use the sandbox that comes with thops APIs from the provider

  1. hackingwithphp.com
    2.The php reference manual php.net
    3.some books you can read
    1. php cookbook
    2. modern php
  2. Laracast
  3. phptherightway.com

Use something else

Thank you very much… let me then pay a visit to one of the PRSPs and see what they offer… I need to write code to register people to a database and send the registration details to yet another set of persons via SMS… I also want to see how one can charge at registration time by calling the M-Pesa API where the user just enters their M-Pesa PIN and the payment is made in one USSD session… That’s the task at hand in summary… I thought that one requires knowledge of PHP to do that but if the PRSPs have such SMS APIs, may be their have different scripting languages other than PHP… I will check it out.

Another question, do the PRSPs host the databases for quick querying?

In that case, all you have to do is organize your logic well as per your process flow. The APIs have implementation in various languages ranging from JAVA, Python, PHP, Ruby & JavaScript so that shouldn’t be a problem. What querying are we talking about? As far as the application is concerned, database implementation is on your side.

Great… I thought that they host the database to reduce the hopping from their server to our servers… I meant USSD queries data from the database and send a response to the requester… the UUSD application, I presume runs in the PRSP environment but the database can be hosted there or elsewhere… wouldn’t it be faster to have the databases hosted where the USSD application is being executed? I know it can be hosted elsewhere as long as there is a stable connection between the servers…

That’s fair enough argument, you may want to look at this and benchmark:

[MEDIA=medium]62c97ef91fdd[/MEDIA]
[MEDIA=medium]ce65e25c890e[/MEDIA]

For USSD it is you who will provide the API, a callback URL to be registered by the PRSP. Whenever a user dials your code, PRSP will simply call your URL passing the necessary parameters. Whatever happens from there it is up to you. It doesn’t have to be PHP on your server you can use any language. Most people prefer PHP because it is easier for them.

Thank you very much!