Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Location
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Posts
    215
    Thanks
    52
    Thanked 1 Time in 1 Post

    What does empty delimiter mean?

    I am getting this warning from a script that is running a foreach loop
    so I don't know which loop is causing this 'Warning', nor why:

    Warning: strpos() [function.strpos]: Empty delimiter in (script file;line indicated)

    The php manual does not indicate in the entry for strpos, which is the delimiter argument. Or is it an argument?

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    yes it does;

    PHP Code:
    int strpos string $haystack mixed $needle [, int $offset] ) 
    in this case the delimiter would be the $needle.

  • Users who have thanked angst for this post:

    anotherJEK (04-17-2012)

  • #3
    Regular Coder
    Join Date
    Aug 2010
    Location
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Posts
    215
    Thanks
    52
    Thanked 1 Time in 1 Post

    empty form textarea element

    Thanks, It is just that I did not see the term 'delimiter' used explicitly
    in the manual entry. I traced the problem to an empty textarea form field.
    so the problem appears to be:
    PHP Code:
    if(strpos($_itemInspected[$_loopIterator], $_emptyFormField) > -1)
      {
       
    // proceed


  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    What is this: > -1? Don't use that. 0 is a valid position, but false is autocast as 0 during a comparison. Use !== false instead.


  •  

    Posting Permissions

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