In my code below substr
function is not working, why it is so and how to make it work.
<?php
// some code
echo "
<h2>".$row['title']."</h2>
<p> substr( ".$row['body'].",0,300) ....</p>
<p>".$row['posted']."</p>";
In my code below
substr
function is not working, why it is so?
How to make it work?
substr
within a variable.Example:
$substr_value = substr($row['body'],0,300);
echo "
<h2>{$row['title']}</h2>
<p>$substr_value</p>
<p>{$row['posted']}</p>";