Veriler ayrı geliyorsa

$sub
$sub = ""; $sub .=
Yani .= ile verileri birleştirmelisin tabi öncesinde boş sub değeri zorunlu.