Changing Inputs to CLI commants PHP CRUD

Hello everyone,

I am trying to create PHP CLI crud app. I need an advise on how can I change inputs to CLI commands, like fgets(STDIN)?

Here is what I have so far:

//register function
function addCompany() {

    $name = "";
    $code = "";
    $phone = "";
    $comment = "";
	$id = 0;
    $update = false;
    
    if (isset($_POST['save'])) {
        $name = $_POST['name'];
        $code = $_POST['code'];
        $phone = $_POST['phone'];
        $comment = $_POST['comment'];

        mysqli_query($mysqli, "INSERT INTO register (name, registration_code, email, phone, comment) VALUES ('$name', '$code', '$phone', '$comment')"); 
        if (mysqli_query) {
            echo "We have added you company";
        }
    }
}

Thank you!