vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Parsing a text file... (https://vborg.vbsupport.ru/showthread.php?t=43938)

Smirks 09-26-2002 01:25 AM

Parsing a text file...
 
Hi,

I'm trying to code something in PHP that will parse a simple text file.

The file contains two lines, looking something like this.

Heading: "A quote of some sort"
List: list of words

What I want to do is leave the "Heading" line untouched. I want to count the words in the List line, and be able to omit certain words from appearing in the list.

:edit:
Also, I want to put comma's in between the words on the 2nd line.

Please note, that the file does actually look like what I wrote above, Heading and List titles too.
:/edit:

How can I do this? I'm quite a novice at PHP, so any help is appreciated!

Thanks,
C

FlyingDutchman 09-26-2002 04:38 AM

where do you keep the list of words? in a file (each on a new line?)? in a (mysql) database? or in the actual php file itself?

Smirks 09-26-2002 12:27 PM

Quote:

Originally posted by FlyingDutchman
where do you keep the list of words? in a file (each on a new line?)? in a (mysql) database? or in the actual php file itself?
The text file contains just what I wrote before. Where the words come from is irrelevant. They're just there. All the PHP code has to do is parse those words, count them and put comma's in between them and be able to omit certian words that may appear.


All times are GMT. The time now is 07:05 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01074 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete