If you need the product, why are you expanding your string at all? You should then be able to calculate your product by simply multiplying the letters by their factors in front. But if I interpret what you say that way, I still don't get your result:

basically i have A,B,C,D,E,F,G,H,J values in an array. The factor's letter should depend on that array. The solution which i want for the string:
$a="4ABC" or "3C" or "2A2B2C" or "ABC" ..
The result of $a should be (A * A * A * A) * (50/100) * B *(55/100) * C * (60/100). This only what i want. The solution given by holli calculates for only certain values. when i tested with some other values it directly prints the string.