M
M
masimka2017-10-16 17:59:13
PHP
masimka, 2017-10-16 17:59:13

How to display failed if condition is not found?

I make a request for the number of TD.class elements

$editLinks = $I->grabMultiple('.cont_editable', 'data-shopname');
 if (count($editLinks) > 1){
            print_r($editLinks);


        } else {
<i>FAILED;</i>
        }

If they are not found on the page or their number is less than 1 then output failed.
how to do it? Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
rudvlad, 2017-10-16
@rudvlad

echo "<i>FAILED;</i>"

S
Stimulate, 2017-10-16
@Stimulate

$editLinks = $I->grabMultiple('.cont_editable', 'data-shopname');
if (count($editLinks) > 1) {
    print_r($editLinks);
} 
else {
?>
    <i>FAILED</i>
<?php
}

M
masimka, 2017-10-16
@masimka

seeNumberOfElements

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question