I have a variable that is the footage of the building units and each unit is separated by "|"
and it can have up to 4 units, eg 35|41|50|12
.
But it does not always have 4 units, ex: 41|50||
Then I need to "break" this variable into individual variables and I thought about doing with explode:
$unidades = $row->fotos;
$unidades = explode("|", $unidades);
$un0 = $unidades[0];
$un1 = $unidades[1];
$un2 = $unidades[2];
$un3 = $unidades[3];
The problem in this case is that from there it brings the empty $ tbm photos.
How can I do to bring only those that have some value? And also get the highest and lowest value?
In summary, what I need is to get the value 35|41|50|12
for example and show the lowest and highest value, something like:
echo $ lowest value. ' to the highest value.