added compatibility for php version < 5.4 (array declaration for str_replace())