limit out put only first 50 leter php mysql

   <td><?php echo $row_Recordset1['BilDetProName']; ?></td>

In the code above how can i set up to show only 50 first leter in the cell in case it have more than 50 leter
for printing purpose
<?php require_once('../Connections/localhost.php'); 
mysql_select_db($database_localhost, $localhost);
$query_Recordset1 = "SELECT * FROM billingdetail WHERE BilDetRef = 31";
$Recordset1 = mysql_query($query_Recordset1, $localhost) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style2 {
	font-size: 14px;
	font-weight: bold;
}
.style3 {color: #000000; font-size: 9px; }
-->
</style>
</head>
 
<body>
<table width="699" border="0">
  <tr>
    <td colspan="2"> <div align="center"><span class="style2"> &#3651;&#3610;&#3648;&#3626;&#3619;&#3655;&#3592;&#3619;&#3633;&#3610;&#3648;&#3591;&#3636;&#3609; / &#3651;&#3610;&#3585;&#3635;&#3585;&#3633;&#3610;&#3616;&#3634;&#3625;&#3637; RECEIPT / TAX INVOICE </span> <em>&#3605;&#3657;&#3609;&#3593;&#3610;&#3633;&#3610;&#3621;&#3641;&#3585;&#3588;&#3657;&#3634;</em></div></td>
  </tr>
  <tr>
    <td width="456" class="style3"><span class="style2">&#3610;&#3619;&#3636;&#3625;&#3633;&#3607; &#3626;&#3617;&#3640;&#3618; &#3648;&#3588;&#3648;&#3610;&#3636;&#3657;&#3621; &#3607;&#3637;&#3623;&#3637; &#3592;&#3635;&#3585;&#3633;&#3604;</span></td>
    <td width="233" class="style2"><span class="style3">&#3648;&#3621;&#3586;&#3611;&#3619;&#3632;&#3592;&#3635;&#3605;&#3633;&#3623;&#3612;&#3641;&#3657;&#3648;&#3626;&#3637;&#3618;&#3616;&#3634;&#3625;&#3637;&#3629;&#3634;&#3585;&#3619; 3 821 018544 </span></td>
  </tr>
  <tr>
    <td class="style3">45/1-2 &#3627;&#3617;&#3641;&#3656; 1 &#3605;&#3635;&#3610;&#3621;&#3649;&#3617;&#3656;&#3609;&#3657;&#3635; &#3629;&#3635;&#3648;&#3616;&#3629;&#3648;&#3585;&#3634;&#3632;&#3626;&#3617;&#3640;&#3618; &#3592;&#3633;&#3591;&#3627;&#3623;&#3633;&#3604;&#3626;&#3640;&#3619;&#3634;&#3625;&#3598;&#3619;&#3660;&#3608;&#3634;&#3609;&#3637;&#3650;&#3607;&#3619;.(077) 425004-5 Fax &#3605;&#3656;&#3629; 18 </td>
    <td class="style2">&#3648;&#3621;&#3586;&#3607;&#3637;&#3656;</td>
  </tr>
  <tr>
    <td class="style3">&#3609;&#3634;&#3617; Name/&#3607;&#3637;&#3656;&#3629;&#3618;&#3641;&#3656; Address</td>
    <td class="style2">&#3623;&#3633;&#3609;&#3607;&#3637;&#3656;</td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
<table width="692" border="0">
  <tr>
    <td width="10">&nbsp;</td>
    <td width="277"><div align="center">Description</div></td>
    <td width="50">unit</td>
    <td width="70">unit/price</td>
    <td width="70">total</td>
  </tr>
  <tr>
    <td>1</td>
    <td><?php echo $row_Recordset1['BilDetProName']; ?></td>
    <td><?php echo $row_Recordset1['BilDetQua']; ?></td>
    <td><?php echo $row_Recordset1['BiDelPrice']; ?></td>
    <td>&nbsp;</td>
  </tr>
<tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3" class="style2">Remark</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

Open in new window

teeraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hernst42Commented:
use

<td><?php echo substr($row_Recordset1['BilDetProName'],0,50); ?></td>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.