<?php

$text = '32137hyb8bhbhu837218nhbuhuh&3298j19j2n39';

echo substr($text, 0, strrpos($text, '&'));