i want to escape special characters being fetched in database and want to replace it with apostrohpe sign, this is how i query database
<div class="row course-boxes">
<?php $count= 0; ?>
<?php
$query= mysqli_query($connection, "SELECT * FROM coruses_list WHERE category_id='$category' ");
while($row= mysqli_fetch_assoc($query)):
$count++;
?>
<div class="col-md-4 col-sm-4 col-xs-12" >
<h2><?php echo $row['course_name'];?></h2>
<p style="height: 110px; overflow: hidden;"><?php echo substr($row['course_description'], 0 , 400);?>...</p>
<a class="btn btn-default" href="course_details.php?course=<?php echo $row['course_id']?>&cat=<?php echo $category ?>">View Details</a>
</div>
<?php endwhile;?>
</div>
but problem is that i am getting output like this
The course will consist of � type
how do i escape or convert them to another character