Bo: Why do you not just store the name's of the people you wish to display as FirstName and LastName in two different columns?
If for some reason you can't or don't want to do it this way then try using str_replace() should do what you want: http://www.php.net/manual/en/function.str-replace.php As for the code, best do things one step at a time: (Assumes MySQL DB) //1). Get DB record/s: while($row=mysql_fetch_assoc($result)) { //2). Get all vars into varspace as columnames: extract($row); //3). Echo vars as columnnames to page with as less code as possible: echo("<td><a href=javascript:popUp('bios/bio_" . str_replace("% %","","$scoutname") . ".html')>" . $scoutbio . "</a></td>"); } //4). Complete your HTML <table>: echo " </tr> </table> "; I'm not sure the syntax is 100% correct - best check out the manual eh? ;-) HTH Russ :-) -----Original Message----- From: bo [mailto:[EMAIL PROTECTED]] Sent: Monday, July 22, 2002 6:11 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] the space in php To Php Gurus: I'm writing some code like this: echo("<td><a href=javascript:popUp('bios/bio_".$row["scoutname"].".html')>".$row["sco utbi o"]."</a></td>"); but the scoutname is something like Mike Johnson, which has a space in bettwen Mike and Johnson, how do I chop this space off, so I can name the corresponding html file as bio_MikeJohnson ? Thanks and any feedback will be appreciated! Good Day. Bo -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -----Original Message----- From: bo [mailto:[EMAIL PROTECTED]] Sent: Monday, July 22, 2002 6:26 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] the space in php (2) Indeed, it's better that if I can just stop when I encouter a space before Johnson, and take the first name(Mike) off. So, the file name will be bio_Mike.html Thanks Bo -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php