I have an array $prices = array();
. This array contains a number of entries that show a price.
For example € 2.500
My goal is to add all this values and have the average number. But first, to have the € 2.500
in the format of 2500
This is what I know and it is done by using
preg_replace('/[^0-9]/i', '', $variable);
What is a way to accomplish this?
Thank you