Jump to content

[SOLVED] splithing a line


alin19

Recommended Posts

<?php

 

$x= file ('C:\Documents and Settings\Administrator\Desktop\php\john.txt');

 

$n = count ($x);

$rand= rand (0,($n-1));

echo trim ($x[$rand]);

 

$arr=explode(" ",$rand);

print_r($arr);

 

?>

 

i want to take a specific line from my file, and print that line how you show me,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.