Why don't you ask earboth what he uses to paste diagrams with his answers. I would like to know how to do that myself.
Getting back to the question, why is P = (x/4)?
You misunderstood what TPH was trying to do. The length of the wire is x. Thus the perimeter of the square is P = x. So one side of the square has a length of x/4. This is what TPH was saying.