Page 1 of 1

php Left Function Help

Posted: Thu Aug 05, 2004 1:21 pm
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

Posted: Thu Aug 05, 2004 1:25 pm
by hawleyjr
Try using [php_man]substr[/php_man]

Posted: Thu Aug 05, 2004 1:40 pm
by carsenault
Perfect =) Thanks a lot!

-C