Navigation

    ask avan logo
    • Register
    • Login
    • Search
    • Categories
    • Unsolved
    • Solved

    How To pair and rearrange string values from a variable in PHP ?

    PHP
    javascript php
    2
    2
    20
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Leo Lesole
      Leo Lesole last edited by

      Capture.PNG
      Let me summarize the above code, the first variable which is Parttype stores a list of part types from an input field, the second variable stores part labels and the third variable stores BIN numbers. As you can see my output from the commented code*(Line 187)*, I to take the first values and pair them together, take the second values and pair them together, and last values to pair them together too. How would I achieve this in PHP, just to summarize my question let me attach an image of what I want.
      Untitled-1.jpg

      Reply Quote 0
        1 Reply Last reply

      • avan
        avan last edited by

        Hey @Leo-Lesole

        To do string concatenation in PHP you can use a period (dot)
        Example:

        $DataToDB = "Parttype=".$partType."&LabelPart=".$labelPart."&PartBin=".$partbin;
        

        Not sure if that is what you had in mind. Let me know.

        Reply Quote 0
          1 Reply Last reply

        • First post
          Last post