No announcement yet.

Query Output problem

  • Filter
  • Time
  • Show
Clear All
new posts

  • Query Output problem

    I am new at php and trying to learn it.
    I have a page lets say new.php and in which there are many names : Maxy, moore, widmore, carlton, charles and many other.
    Then I have a form on the other page, through which name gets processed and gives an output. Example : form gives an output as "Charleston" .
    now here is the query :
    I want to make sure that the new.php has the name "charles" and form outputs as charleston, i want to remove the unwanted "ton" name from that and process it according to my need. My query doesn't need it to strip while processing the form. I need it to remove extra after form has been processed. How do i achieve that?
    Also as new.php has thousands of names, how do i find out which names to be taken correctly and then use it for removing the extra words after form has processed. I can use string_replace and how do i process the names in array? Do i need another way to do it.

  • #2
    It all depends on how new.php populates the page, are you storing the names in a database? some code from new.php would also be great. And your post probably hasn't been answered because it is very hard to understand exactly what you want. Why would you need to strip the last 3 characters off the name? If you need to do that on every name entered then sure, easy, but it will remove the last three characters on everything no matter, you can't pick and choose which to do it unless you have a specific pattern that you are looking for,
    Have a Script or Snippet you want to share?

    WWW Standards: HTML 4.01,
    HTML 5, CSS2.1, CSS3, XHTML 1.0
    PHP Standards: PHP Standards