mardi 25 septembre 2018

PHP if else not working when use multi variable with OR

I have laravel blade template that use if else to show the alert.

here my code

@if($foo = Request('foo') and ($bar = Request('bar')))
    Search result for: <strong> and 
@endif

on my code above

it's working if both forms filled. but when one of them form empty its print nothing.

how to make it if one or both filled its return like :

one form filled.

Search result for: Keyword

both form filled.

Search result for: Keyword and category

Aucun commentaire:

Enregistrer un commentaire