I am pretty new to PHP and I am looking at a way to recurse an array and go to a specific function depending on the contents of the array.
For example if I have an array with the 3 values of 'email, name, password '
I would need my code to run each of them functions.
The following code is what I currently have.
<?php
$a = $_POST;
/**
*datavalidation
*/
class validation
{
// private $output = [];
public $data = [];
function __construct($data)
{
$this->data= $data;
$this->begin();
}
function begin()
{
foreach ($this->data as $key => $value)
{
$this->$key;
}
$this->__destruct();
}
}