maiko
maiko

Reputation: 11

Bootstrap glyphicon in php

I am having a trouble using Glyphicons in PHP. Here is the error:

Parse error: syntax error, unexpected ''glyphicon-ok'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';'

<i class="glyphicon
<?php 
echo $output 'glyphicon-ok';?> "></i>

Upvotes: 0

Views: 850

Answers (2)

Sadikhasan
Sadikhasan

Reputation: 18600

You are missing concatenation operator .(dot) after echo $output.

<i class="glyphicon <?php echo $output.'glyphicon-ok';?> "></i>
                                     ^^^^

OR might be you want this

<i class="glyphicon glyphicon-ok"></i><?php echo $output;?>

Upvotes: 0

Forien
Forien

Reputation: 2763

So far I can only guess, but probably you wanted something like this:

<span class="glyphicon glyphicon-ok"></span> <?= $output ?>

If doesn't work due to <?= tag, change then to <?php echo $output ?>

Upvotes: 1

Related Questions