0
Well, good evening guys, I want to make it clear here that I’m not a professional programmer or anything like that, I just pick up a few nozzles that come up and, specifically on this one, I took it for good...
The knowledge I have of php is basic (I think) and this is not allowing me to solve the following problem:
I have this first list here:
05:50 AUDJPY CALL
06:00 EURCHF PUT
08:25 GBPAUD PUT
08:40 USDJPY PUT
10:05 GBPJPY CALL
And she has to "reorder" for that:
AUDJPY 05:50 CALL
EURCHF 06:00 PUT
GBPAUD 08:25 PUT
USDJPY 08:40 PUT
GBPJPY 10:05 CALL
So basically just "reverse" the position of the time with the currency pair
As I don’t know much about php, I ended up discovering several functions present in the language, but none of them helped me (things like explode, implode and wordwrap) and also tried several other possible alternatives, but none I succeeded.
My job is to make a code where:
The client enters the list 1 (in its form) and is returned to the list 2 (reordered)
Any help will be very welcome, I’m already crazy here and I can’t think of anything else
Below is a very useless 'progress' that I did, I used the wordwrap function to break the spacing of some characters in the list, it was even more organized than the original list, but it is not yet what I need...
<?php
$lista = "
05:50 AUDJPY CALL
06:00 EURCHF PUT
08:25 GBPAUD PUT
08:40 USDJPY PUT
10:05 GBPJPY CALL ";
$newtext = wordwrap($lista, 15, "<br />");
echo "$newtext" ;
?>
I don’t quite understand the transition from list 1 to list 2. You want to sort list 1 based on time?
– Lucas Pace
Lucas Pace, I just want to take the element "currency pair" (that would be the USDJPY and throw it forward, since in the list that the customer will provide, it is in the middle. If you have not understood I can explain again kkk
– Lucas Copatti
Augusto Vasques, there is in php some function that I can sort of "select from a string to a limit and throw that string to another position then?
– Lucas Copatti
Ah, Lucas Pace, I think I understand what you mean, no, time has no importance of order there... I just want to change position even
– Lucas Copatti
Gee, Augusto, I entered the wrong list 2, I just corrected!
– Lucas Copatti