PHP function using strlen,str_repeat,ucfirst to return a name based on requirements

I don’t know how to start make this function based on these requirements, I don’t manage the “order” of how this should work here;Create a function called repeat_name that receives a name as a parameter, the function must verify that the name contains 4 or more characters, if so, it will convert the name all in uppercase and the function will return that name in uppercase, repeating the same number of times as characters have. In case the name doesn’t have 4 or more characters, the function will return the name in reverse and with the first letter capitalized.
Example 1:
repeat_name(“Alex”);The output should be: ALEX ALEX ALEXSince “Alex” has 4 characters, this function should return the name in CAPS 4 times.
Example 12:
repeat_name(“Amy”);The output should be “Yma”This is because “Amy” has less than 4 chracters, so the function should return the name in reverse witht he first letter in CAPS