The picture will be choose automatic with the old of the person.
$this->date4 = Year of the date of birth like “XXXX”
So for example, we will choose: 90 = 1990 but we take the last two number.
We will take the sexe: $this->sexe (“M” or “F”)
And then the function.
For something like this I would most likely use a select drop down or radio buttons with predefined values instead.
But anyway, explanations such as “problem” or “doesn’t work” aren’t the most helpful for me. I have better luck understanding error messages. If you have seen any, please post them. If you haven’t, please enable error reporting and display while you’re developing the code. i.e. this at the beginning of the file:
<?php
declare(strict_types=1); // if PHP ver 7+
ini_set('display_errors', 'true');
error_reporting(-1);
There are more sophisticated ways of dealing with errors, but for now simple echo, print_r and var_dump lines should be easy enough for you do to and help you see what’s happening with the code.
I think a good start would be to temporarily change your code so it’s like this eg.
$age = explode($this->date4[2].$this->date4[3]);
print_r($age); // remove this line after debugging
exit; // remove this line after debugging
$photos_path = "static/photos/" . .....
Does what you see look like what you expect to see?