I have an array with multiple strings, like this:
$str[0] = \"kasdnkjsandjabsdkjsbad\";
$str[1] = \"kasdnkjsandjasdjksabdjkasbkjdsak\";
$str[2] = \"kasdnkjsa
I am assuming you want to iterate through each string in the array and trim it to a specific length.
Create a function that does this to a single string (as an argument). Use array_map
to apply this function to each element in the array.
Try this yourself - if you have any problems, append your attempt to your question.