3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $line = '"1212","$ 507.74","$ 0.00","$ 2,954.16","Kč 9,647.00","","TDR 697","","Kč 23,737.00","","","","","Kč 457.00","","","","","Kč 29,959.00","","","","","$ 104.00","","3232"'; $line = explode('","', $line); $line[0] = substr(trim($line[0], "\t\n\r"), 1); $line[count($line)-1] = substr(rtrim($line[count($line)-1], "\t\n\r"), 0, count($line)-1); $lastItem = $line[count($line)-1]; echo substr(rtrim($lastItem, "\t\n\r"), 0, count($lastItem)).PHP_EOL; echo substr(rtrim($lastItem, "\t\n\r"), 0, count($lastItem)-1).PHP_EOL;
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
3
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Tj1qt on line 9 3PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Tj1qt on line 10 PHP_EOL