Home > other >  Read file to array, find key and echo value
Read file to array, find key and echo value

Time:02-10

I need you help guys, I have a txt file whit 2 columns, A and B:

5|outra info coiso xd
2|frase coiso blablabla
5|coiso frase teste

I want to echo the contents of column B, in the lines that correspond to A when $count is equal to any A line. Like this:

for($count=0;$count<100;$count  ){ //count to 100
    
    IF $count == someColumnA[0] THEN ECHO  theContentColumnB[1];
    sleep(10);
}

CodePudding user response:

  •  Tags:  
  • Related