Q:

how to writhe a Php inside HTML with substr

I write this bellow code
<div class="description"><?php echo substr($data['description'],strpos($data['description'],$info['title']),100); ?></div>

when I change method to this bellow code I get an error!!
 <?php echo'<div class="description">'.substr('.$data['description'].',strpos('.$data['description'].','.$info['title']).',100).'</div>'; ?>

error: Parse error: syntax error, unexpected T_STRING...

A:

You need to write your PHP code inside <?php and ?> tags.
You cant just write your php code as a string. PHP interpreter needs to know what code should be interpreted.
EDIT:
You cant put variables names in quotes. Try this:
<?php echo '<div class="description">' . substr($data['description'], strpos($data['description'], $info['title']), 100) . '</div>'; ?>

