• Resolved ScoobySteve

    (@stevedeboo)


    I have a simple php script that I want to run a IF statement with but I cant get it to work.
    This is being put into a single listing page called single-liasting.php
    the following code returns

    “site/en/listing/bpa” in the echo.

    <?php
    $company=substr(get_permalink(),35);
    echo $company;
    ?>

    But I cant get this to work.

    <?php
    $company=substr(get_permalink(),35);
    if $company=”site/en/listing/bpa” {
    echo “It works”;
    }
    ?>

    nay ideas please

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP if statement’ is closed to new replies.