SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wierd syntax error

    Anyone know why this piece of code would give me an error?

    if (!empty($this->form->get_cleaned_var('street')))

    here's the error ...

    Parse error: parse error, expecting `')'' in xxxxxxxxxxxxx

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    what is $this->form->get_cleaned_var('street') outputting?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    empty() only works for variables, not values returned from function/method calls etc. So empty($foo), empty($bar) are ok but empty($foo->bar->somecall()) would give an error.
    Having said that I wouldn't expect that exact error you're getting so maybe paste the lines of code surrounding that error and maybe the get_cleaned_var() method too.

  4. #4
    SitePoint Evangelist ikeo's Avatar
    Join Date
    Oct 2004
    Location
    Austin Texas
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a million for pointing that out markl999 ... I'll re-do the code to get around that.


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
  •