php - Is there a typo in this str_replace code? / Am I reading it correctly? -


Here is the line of code from a PHP file, in particular it is from zstore.php, which is part of a file Forms of "Zzele Store Builder" ToolsSet

set by Jezele.com gives to anyone like me, who have products for sale at Zaza and have massages that give data a good " Storefront "which I can set in my way to the Zayzle.com Rather than being confined by the CMS structure of C, they want to keep the monkey (Uhmi ... like users) from creating too much delusional. Therefore ... here code:

$ keyword = str_replace ("", ",", str_replace (",", "", $ keyword));

Two questions:

  1. Do I understand what it does and
  2. Is there an extra single or double in the string? Need quote?

    I think the line of code is saying:

    Take a string of characters in the user input (dance divis) and specify it in the designated variable

    $ keyword

    Then run the following function on that character string

    = str_replace

    ("", "," << code>

    , str_replace (",", "" this

    I think it's a bit If you find a comma, leave them alone, but I'm not sure.

    , $ keyword));

    To see if I was inputting the following:

    Dance, Diva, which I think The script that I wanted was based on the commented text in the README.txt file:

    // search term. Al Keywords separated by comma, which you can use to select products for your store

    Such ..

    1. Do I understand What is that line of code?

      That's right, I'm right, and I'm pretty sure that the first half should work as I have said, now I have been brought to my second question:

      1. Why is not the other thing working? Type again?

        To review:

        The dance lamp produces results
        dance, not a lamp

        Both should work. / P>

        Thank you in advance for your help, I have a lot of HTML experience and computer experience but PHP is new to me.

          $ keyword = str_replace ("", ",", str_replace ("," "", $ Keyword));   

        You can divide

          $ temp = str_replace (",", "", $ keyword); $ Keyword = str_replace ("", ",", $ temp);   

        Firstly it replaces all the comas with an empty string, it removes all commas, then all the places are replaced with commas.

        There is no comet for "dance lamp", there is nothing in the first place, then it takes place in space and the result is for "dance, light"

        "Dance", Diva "This removes coma, you get" dance "and there is no place to change to the next place, so this is your result.

Comments

Popular posts from this blog

jasper reports - How to center align barcode using jasperreports and barcode4j -

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -