• This is driving me crazy !

    On the post page,

    [audio:my.mp3]

    works perfect.

    but,

    <phpcode>
    <php echo “[audio:my.mp3]”; ?>
    </phpcode>

    NOT working : unexpected T_STRING, eval()’d code…

    I tried change the code to cheat :

    <phpcode>
    <?php
    $audio = “[audio”;
    $str = $audio.”:my.mp3]” ;
    echo nl2br(htmlentities($str));
    ?>
    </phpcode>

    What I got is the plain texts showing up: [audio:my.mp3], instead of player controller.

    How to fix this ? Please urgent ! I am online waiting 24 hours for solutions….

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter stevenzhou

    (@stevenzhou)

    This Forum is not helpful, I have been waited many hours online, got no response back.

    Thread Starter stevenzhou

    (@stevenzhou)

    help please help

    Thread Starter stevenzhou

    (@stevenzhou)

    OK, I finally figure it our:

    echo ‘[audio:my.mp3]’;

    works.

    but

    echo “[audio: my.mp3]”;
    not working.

    so the reason is here:

    PHP lets you define strings using single quote, double quotes or heredoc. There’s a crucial difference between the first two and for some reason many people new to PHP start using double quotes. Hopefully the following explanation will save a couple of hours debugging for the starters among us.

    The most important difference between the two is that a string enclosed in double quotes is parsed by PHP. This means that any variable in it will be expanded.

    echo $var; // Results in the value of $var being printed
    echo ‘$var’; // Results in the word ‘$var’
    echo “$var”; // Results in the value of $var being printed

    Thread Starter stevenzhou

    (@stevenzhou)

    Damn, a new issue:

    if I do this cycle, it retunes only 1 player on the post, why ?

    <?php
      for ($i=1; $i<=10;$i++)
    echo '[audio:1.mp3]';
    
    ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Audio Player] weird weird thing : php echo "[audio:my.mp3]" not working’ is closed to new replies.