[SOLVED] php Left Function Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
carsenault
Forum Newbie
Posts: 2
Joined: Thu Aug 05, 2004 1:21 pm
Location: Maine, USA

php Left Function Help

Post by carsenault »

I know this is a silly question and I'm sure I'll realize exactly what's wrong after I post it, but I'm having trouble with the Left function in a site I'm designing. I basically just want to ouput the first 45 characters of a record, so I'm doing this:

<?php $var_string=Left($row_Recordset1['Body'],45); ?>
<?php echo $var_string; ?>

My guess is that I'm missing quotes or double quotes somewhere important, but I can't figure out what it is for the life of me. (Boss is on vacation, senior web developer is visiting sick relatives, etc, so I'm all alone here). Any ideas

Thanks,
Chad
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Try using [php_man]substr[/php_man]
carsenault
Forum Newbie
Posts: 2
Joined: Thu Aug 05, 2004 1:21 pm
Location: Maine, USA

Post by carsenault »

Perfect =) Thanks a lot!

-C
Post Reply