First, make your weights relative whole numbers. (1 and 2 instead of 0.5 and 1).
Read your table and, for each record, write the text into an array. The number of times you add it to the array will be governed by the weight value.
Do a random selection from the array.
$textarray = array();
$res = mysql_query("select `text`, weight from mytable");
while (list($txt, $wt) = mysql_fetch_row($res)) {
for ($i=0; $i < $wt; $i++)
$textarray[] = $txt;
}
$key = array_rand($textarray);
echo $textarray[$key];
hth