Learning PHP

Jimjones

Village Elder
#1
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?
 

WIGSPLITTA

Village Elder
#3
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?
To understand the basics and familiarize yourself with the syntax, begin here: https://www.w3schools.com/php

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

kalicraft

Senior Villager
#6
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.
 

Jimjones

Village Elder
#8
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.
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...
 
#10
Use sololearn for quick learning
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++)...
 

conoiseur

Village Elder
#11
For learning: There are many options/sites:

  1. W3Schools
  2. Code academy
  3. Tutorials point
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
 

Jimjones

Village Elder
#14
For learning: There are many options/sites:

  1. W3Schools
  2. Code academy
  3. Tutorials point
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
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?
 
Last edited:

conoiseur

Village Elder
#15
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.
 

Jimjones

Village Elder
#16
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....
 

conoiseur

Village Elder
#17
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:

 

Ashken

Village Elder
#18
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.
 

Top