I need to use the indexed element as the amount to change the date by
$id = $_POST['id'];
$ids = explode(',',$id);
$dateCreated = date('Y-m-d');
$dateExpiredtemp =date_create($dateCreated);
date_modify($dateExpiredtemp,'+ $ids[2]');
$dateExpired = date('$dateExpiredtemp');
date_modify($dateExpiredtemp,'+ $ids[2]');
This line provides this error
Warning: date_modify(): Failed to parse time string (+ $ids[2]) at position 0 (+): Unexpected character in
$ids[2] is a string and it needs to be carried into the altering parameter of date_modify