• sarkishage

    (@sarkishage)


    If i have this code in single-post.php

    $tube= “abcdefghi”
    $sub2 = substr ( $tube ,5);
    echo “$sub2” ;
    ?>
    <script type=”text/javascript”>
    var flashvars = {};
    flashvars.v = “.$sub2.”; ….. </script>

    this return .$sub2. in my source page…
    how i can return the value of $sub2 like below ??

    $tube= “abcdefghi”
    $sub2 = substr ( $tube ,5);
    echo “$sub2” ;
    ?>
    <script type=”text/javascript”>
    var flashvars = {};
    flashvars.v = “fghi”; ….. </script>

    Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    WordPress forums are not general CSS and HTML and PHP support forums. They are not intended for support for any and all website issues you might have.

    Thread Starter sarkishage

    (@sarkishage)

    ok, thank you Andrew for this note ??

    Michael

    (@alchymyth)

    you need to echo the variable;

    flashvars.v = "<?php echo $sub2; ?>"; ..... </script>

    Thread Starter sarkishage

    (@sarkishage)

    alchymyth this is vrey useful! my problem has been vanashid.. thx a lot ??

    Michael

    (@alchymyth)

    this is still basic php which you will need to learn rather sooner than later if you want to continue customising themes;

    https://www.w3schools.com/php/default.asp

    or look for other online tutorials…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘help with php code plz’ is closed to new replies.