SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2011
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    strlen not working

    The following is not working for me when $text exceeds 100 characters. The if statement fails to run.

    PHP Code:
    if (strlen($text >= 100))
    {    
     
    // do something

    What am I doing wrong here?

  2. #2
    SitePoint Addict
    Join Date
    May 2005
    Location
    Tauranga, New Zealand
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ShinVe View Post
    The following is not working for me when $text exceeds 100 characters. The if statement fails to run.

    PHP Code:
    if (strlen($text >= 100))
    {
     
    // do something

    What am I doing wrong here?
    You need strlen($text) > 100, note where I put the brackets
    http://www.automatem.co.nz
    Websites, On-line Software and everything Internet
    Follow on Twitter | Connect on LinkedIn | Read on Posterous

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2011
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •