|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Mar 2004
Posts: 5,116
|
PHP: How to pick ~15 lines of text from a textfile and put them on my site?
I know we got some good PHP programmers around here. Anyone want to help me with this?
I got a textfile with about ~500 lines of text. I want to pick like 15 random lines and show them on my page. Anyone know how I can do this? |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Dec 2004
Location: ICQ: 251-911-362
Posts: 915
|
I can do that for you.
ICQ to the left..
__________________
see sig above mine |
|
|
|
|
|
#3 |
|
Confirmed User
Join Date: Jul 2003
Location: chicago
Posts: 1,135
|
pretty simple...
Code:
<?php
$a = file("somefile.txt");
for($b=0;$b<15;$b++)
echo $a[array_rand($a)];
?>
|
|
|
|
|
|
#4 | |
|
Confirmed User
Join Date: Mar 2004
Posts: 5,116
|
Quote:
|
|
|
|
|