• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

if statement inside concatenation

phpconcatenation


PHP Snippet 1:

while($data = $result->fetch_object()) {
    if($data->verified) {
        $icon = '<i class="fa fa-check-circle"></i>';
    } else {
        $icon = '';
    }
    $content .= '

    <div class="caption animated fadeIn">
            <a href="profile/' . $data->username . '">'.$icon.'<img src="' . self::display_image(AVATARS_THUMBS_ROUTE . $data->avatar) . '" class="img-circle dashboard-avatar" alt="Avatar"/></a> <a href="profile/' . $data->username . '">' . $data->name . '</a><span>' . Messages::generate_emoticons(User::generate_links($data->content)) . '</span>
    </div>
    ';
}

Related Snippets

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Coinpayments create_transaction "ERROR: Invalid command!"

Woocommerce Edit Message "An account is already registered with your email address. Please log in."

What is my SQL missing?

How do I call a php file with axios?

php echo remove slashes from url [duplicate]

Display specific shipping method if woocommerce product has specific acf field value

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

Get all WooCommerce products within own plugin

Transpose multidimensional array and join values with commas

Select option menu read from database and use it's values

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

Installing Composer - Internal Error

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

Laravel SQL query midnight time not showing

About Contact Privacy policy Terms and conditions