HI!
I'm doing a little application using PHP, but I'm stuck because I have to read a text file (*. txt) that is where my information, and I present it, but I could not find the necessary algorithms for words, sentences or paragraphs in a specific area of the text file, but it has full
I hope it is clear
"I can do?
txt with PHP
Moderator: General Moderators
- DaveTheAve
- Forum Contributor
- Posts: 385
- Joined: Tue Oct 03, 2006 2:25 pm
- Location: 127.0.0.1
- Contact:
Re: txt with PHP
http://php.net/explode -- Check it out. ;P
Code: Select all
<?php
$file = file_get_contents('NosePickerLog.txt');
//Have an array of sentaces:
$sentances = explode("\n",$file);
/*
array {
[0] = 'Day 7/9/10',
[1] = 'Time 10:50am',
[2] = 'Left Nostile has a large rock it in'
[...]
}
*/
//Have an array of words:
$words = explode(' ', $file);
/*
array {
[0] = 'Day',
[2] = '7/9/10',
[3] = 'Time',
[4] = '10:50am',
[5] = 'Left',
[6] = 'Nostile',
[7] = 'has'
[...]
}
*/