Skip to content
  • Home
  • Techpoint
  • Docs
  • Glossary
SOLID FUTURE

SOLID FUTURE

Networking DevOps Tools and Guides

  • IT Infrastructure
    • Cloud Computing
    • Networking
      • Cisco Certified DevNet Associate
    • Internet of Things
    • Cybersecurity
  • Software Development
    • Software Engineering
    • Artificial Intelligence
    • Virtual Reality
    • Augmented Reality
  • Data Management
    • Distributed Ledger Technologies
      • Blockchain
    • Big Data
    • Competitive Intelligence
    • Privacy Instances
  • Toggle search form

Web Platforms

  • WordPress MYSQL Docker Compose YAML File
  • Portainer Port 8000, 9443, and 9000 in Docker
  • USSD Coding / Programming in PHP Code
  • GED General Equivalency Development Diploma Meaning

Cloud Platforms

  • Best Linux Distro for Docker: Why Linux is the best operating system for Docker
  • Portainer Port 8000, 9443, and 9000 in Docker
  • How to use Firebase Deploy Only Hosting to Host Websites on Firebase
  • Linode Docs: How to Create a $5 Monthly Linode Virtual Private Server

Software Applications

  • USSD Coding / Programming in PHP Code
  • WordPress MYSQL Docker Compose YAML File

Networking

  • Secure Socket Layer in Cryptography and Network Security
  • Portainer Port 8000, 9443, and 9000 in Docker
  • The 7 Layers of the OSI Model and their functions explained

Dockerfiles

  • Dockerfiles in Portainer: Dockerize a Custom App in Portainer
  • Nginx Proxy Manager Docker Compose YAML file
  • WordPress MYSQL Docker Compose YAML File
  • Portainer Docker Compose YAML File
  • Portainer Dockerfiles – Python Flask Example
  • Home
  • Documentation Hub
  • Software Applications
  • USSD Coding / Programming in PHP Code

USSD Coding / Programming in PHP Code

For a full playlist of USSD Programming Video: Visit this Link (USSD Programming Playlist). The USSD code below is for the YouTube Video below this code.

USSD Programming PHP Code #

<?php
// Read the variables sent via POST from our API
$sessionId   = $_POST["sessionId"];
$serviceCode = $_POST["serviceCode"];
$phoneNumber = $_POST["phoneNumber"];
$text        = $_POST["text"];

if ($text == "") {
    // This is the first request. Note how we start the response with CON
    $response  = "CON What would you want to check \n";
    $response .= "1. My Account \n";
    $response .= "2. My phone number";

} else if ($text == "1") {
    // Business logic for first level response
    $response = "CON Choose account information you want to view \n";
    $response .= "1. Account number \n";

} else if ($text == "2") {
    // Business logic for first level response
    // This is a terminal request. Note how we start the response with END
    $response = "END Your phone number is ".$phoneNumber;

} else if($text == "1*1") { 
    // This is a second level response where the user selected 1 in the first instance
    $accountNumber  = "ACC1001";

    // This is a terminal request. Note how we start the response with END
    $response = "END Your account number is ".$accountNumber;

}

// Echo the response back to the API
header('Content-type: text/plain');
echo $response;

USSD Coding Programming Tutorial #

USSD Coding
What are your Feelings
Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on April 4, 2023

Powered by BetterDocs

Comment (1) on “USSD Coding / Programming in PHP Code”

  1. dilane says:
    March 7, 2026 at 4:28 pm

    Hi.Please I wish to learn more on the creation of ussd app.Up till now my level is very low in programming

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Table of Contents
  • USSD Programming PHP Code
  • USSD Coding Programming Tutorial
Solid-Future.com
  • Big Data Management
  • Distributed Ledgers
  • Software Engineering
  • Artificial Intelligence
  • USSD Programming Code
  • Podman vs Docker
  • Best Linux Distro for Docker
  • SSL in Network Security
  • Install docker compose ubuntu
  • Firebase Deploy Hosting
  • Skilleo AI
  • Skilleo Resources
  • VPS Cloud Hosting
Documentation Hub USSD Coding / Programming in PHP Code
  • Cloud Computing
  • Computer Networking
  • Internet of Things
  • Cybersecurity
  • Portainer Dockerfiles
  • Firebase deploy only hosting
  • Portainer Dockerfiles
  • Portainer Docker Compose
  • What does YAML stand for ?
  • Portainer Ports 8000
  • USSD Programming

Agentic AI AI AI Agents Artificial Intelligence Docker docker-compose docker compose dockerfile How to install portainer ubuntu 20.04 ubuntu 20.10 YAML yml

Firebase Deploy Only Hosting

Copyright © 2026 SOLID FUTURE.

Powered by PressBook Blog WordPress theme