In cases where you have a flat array with values that contain non-digit characters and you need to remove them, there are a few approaches you can take:
array_splice($milestone, 0, 1); dump($milestone);
This method uses the array_splice() function to remove the first element of the array, which is the non-digit character. It then uses the dump() function to display the modified array.
$milestones = array_values($milestones);
This method uses the array_values() function to re-index the array, effectively removing any non-digit characters. It is useful if you are working with a collection and want to retain the original keys.
$milestones = $milestones->values();
Similar to the previous method, this one uses the values() method on a collection to call array_values() on the items in the collection. This approach is particularly useful when working with Laravel collections.
$milestones = str_replace(array('[', ']', '"'),'',$milestones);
This method uses the str_replace() function to remove specific characters from the milestones string. In this case, it removes square brackets and double quotes. It is useful when you need to remove specific characters from the array values.
The choice of method depends on the specific requirements of your project and the nature of the data you are working with. Consider the context and the specific characters you need to remove when selecting the most appropriate approach.