You can use the length function to find out how long a string is.
You can use substr to get the first 35 characters. And to get the last 15.
Assuming you put the first 35 characters in $start and the last 15 characters in $end you can put your variables in quotes to get the new link label...