Problem with Hyphen (-) form

Discussion in 'PHP' started by mfp, Mar 18, 2009.

  1. #1
    I need solution for a form which is passing value contained Hyphen (-) in it. But when I store its value in a php variable, i am getting only text before hypen sign (like QP-1A-0000 is the value to be stored on variable, but variable $x is storing value only QP in it)

    any solution?
     
    mfp, Mar 18, 2009 IP
  2. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There should be no problem with hyphens under ordinary circumstances.

    Some things to check:

    1) Is it really a hyphen and not one of the dashes found in various character sets? Text pasted from Microsoft apps often has en-dashes or em-dashes in it. If you need to deal with these, you will have to become aware of encoding in your HTML and database.

    2) What do you see when you var_dump($_REQUEST) ?
     
    SmallPotatoes, Mar 18, 2009 IP
  3. mfp

    mfp Guest

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for ur reply brother... I am learning php & mysql... it was my fault... i was selecting wrong checkbox... but thanks for ur help...
     
    mfp, Mar 18, 2009 IP