How to replace letter position?

Discussion in 'PHP' started by golf98765, Nov 11, 2006.

  1. #1
    How to replace each letter on each position?

    ex.
    $word = compare price

    /* if letter position = a => replace q,w,s,x,z on a
    if letter position = b => replace v,f,g,h,n on b
    if letter position = c => replace x,s,d,f,v on c
    if letter position = o => replace i,k,l,p on o
    if letter position = m => replace n,h,j,k on m
    if letter pos..
    .
    .
    .

    and the result will be :

    xompare price --- letter position 1 changed.
    sompare price --- letter position 1 changed.
    dompare price --- letter position 1 changed.
    fompare price --- letter position 1 changed.
    vompare price --- letter position 1 changed.
    cimpare price --- letter position 2 changed.
    ckmpare price --- letter position 2 changed.
    clmpare price --- letter position 2 changed.
    cpmpare price --- letter position 2 changed.
    . --- letter position 3 changed.
    .
    .
    till end position
    */

    What's the script?


    Thank you.
     
    golf98765, Nov 11, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Is it just me, or is someone else confused by this.

    Please explain yourself better.
     
    nico_swd, Nov 11, 2006 IP
  3. thedark

    thedark Well-Known Member

    Messages:
    1,346
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    168
    Digital Goods:
    1
    #3
    use str_replace or preg_replace , or search for other function on php.net
     
    thedark, Nov 11, 2006 IP
  4. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This is an interesting question because it matches precisely with one techniques used by spammers to "confuse" bayesian filters. Is that your intent?

    What is the thinking behind your choice of replacement letters?
     
    clancey, Nov 11, 2006 IP
  5. golf98765

    golf98765 Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i'm writing misspell word script.

    you can see letter
    q,w,s,x,z -- close to "a"
    and v,f,g,h,n -- close to "b" on your keyboard.


    anyone can help?
     
    golf98765, Nov 12, 2006 IP
  6. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #6
    There are so many free tools available to find out all misspellings possible
     
    it career, Nov 12, 2006 IP