I am using a rating system on my site and I call for the value “4_5” in php.
Example:
<span class="rating"><?php echo $meta['rating']; ?></span>
Is there a way I could use this…
$name = str_replace('_', '.', $name);
to replace the underscore after calling for it?
PS. I’m very new at php and html but have searched for this everywhere!
You can’t modify a value in PHP after you echoed it.
But you don’t even need to, because you can use the str_replace around your $meta[‘rating’] like this:
This will display 4_5 as 4.5