Substr

Discussion in 'PHP' started by baris22, Jan 10, 2008.

  1. #1
    Hello,

    How I want to use this

    
    <?=substr($row['video_title'],0,20); ?>
    
    PHP:
    substr on here

    
    <a href=\"video-izle.php?vid=".$row['uniq_id']."\" class=\"song_name\">".$row['video_title']."</a>
    
    PHP:
    I do not know how to do.

    Can anyone help me.

    Thanks
     
    baris22, Jan 10, 2008 IP
  2. WebGyver

    WebGyver Guest

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, it looks as though you want to do something like this:

    <? $myVideoTitleVar=substr($row['video_title'],0,20); ?>
    PHP:
    And then later, re-use the same variable:

    <a href=\"video-izle.php?vid=".$row['uniq_id']."\" class=\"song_name\">".$myVideoTitleVar."</a>
    PHP:
    Of course, I could have totally missed the pint of what you're asking about...if that's the case, please let us know in more detail what you're after.
     
    WebGyver, Jan 10, 2008 IP
  3. baris22

    baris22 Active Member

    Messages:
    543
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thank you. it was what i wanted.


     
    baris22, Jan 10, 2008 IP