I keep getting the following error in PHP:
[13-Jul-2019 06:49:43 UTC] PHP Warning: Illegal string offset 'text' in /home/catchandreport/public_html/sweettune.info/LikeDislike/index.php on line 15
Is there any way that I can replace my string with something else?
I haven't tried anything yet. While I'm at it, this is a totally different problem, but in another line of code I get
Illegal string offset 'id'
Is there something I'm doing wrong that I can change?
<?php echo $post['text']; ?>
<div class="post-info">
<!-- if user likes post, style button differently -->
<i <?php if (userLiked($post['id'])): ?>
class="fa fa-thumbs-up like-btn"
<?php else: ?>
class="fa fa-thumbs-o-up like-btn"
<?php endif ?>
data-id="<?php echo $post['id'] ?>"><img src="catlogo.ico"></i>
<span class="likes"><?php echo getLikes($post['id']); ?></span>