Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
function stroka($i){
// $f = file ('test.txt');
$f = [
"123",
"231",
"312",
];
if (!$f) {
die ("open failed\n");
}
$cnt = count ($f);
$str = '';
if ($i < $cnt and $i>=0) {
$str = trim ($f[$i]);
echo $str;
}
}
$a = stroka(0);
var_dump($a);
?>