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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    replacing characters in a string

    anybody have a simple php script that i can use to replace characters in a string? i want to replace all hyphens with spaces....

    *edit-also, how do i compare one string to another without considering capitalization. example, i'd like if (steve==Steve) to result in true.

    thanks in advance,
    steve
    Last edited by se4b4ss; 10-20-2004 at 09:27 PM.

  • #2
    Regular Coder
    Join Date
    Feb 2004
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, got the str_replace to work...

  • #3
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just transform both values to all-uppercase or lowercase (with strtoupper() ) or lowercase (with ...)
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

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