hai provato a stampare con un echo $value per vedere se ti arriva effettivamente quello che ti aspetti?

ciao