Greenguy's Board


Go Back   Greenguy's Board > General Business Knowledge
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2009-02-13, 03:42 PM   #1
NY Jester
ICQ:147*079*406
 
NY Jester's Avatar
 
Join Date: Oct 2007
Location: Rock*ME*Hardplace
Posts: 2,996
Send a message via ICQ to NY Jester Send a message via AIM to NY Jester
Thanks Bob and CD, I'll be working on this over the weekend Ill post my results LOL wish me luck. haha
__________________
The Sexy Side of Porn
NY Jester is offline   Reply With Quote
Old 2009-02-13, 05:06 PM   #2
plateman
What can I do - I was born this way LOL
 
plateman's Avatar
 
Join Date: Oct 2003
Location: ohio
Posts: 3,086
off topic here but text magician can save a bunch of time when making text files for importing galls into tgp scripts

like adding custom stuff that a lot of sponsor text file tools won't add
__________________
Submit to: Porn O Plenty XXX Links
Reality Here
plateman is offline   Reply With Quote
Old 2009-02-13, 08:29 PM   #3
dunc
You can now put whatever you want in this space :)
 
dunc's Avatar
 
Join Date: Feb 2007
Location: Australia
Posts: 658
Sort of related - I have a bunch of stories which I want to use - but all the lines are double spaced

Is there a way of clearing all empty lines using php...
dunc is offline   Reply With Quote
Old 2009-02-13, 08:38 PM   #4
Beaver Bob
Porn Blog Addict
 
Beaver Bob's Avatar
 
Join Date: Oct 2005
Location: Las Vegas, Nevada
Posts: 715
Send a message via ICQ to Beaver Bob
Quote:
Originally Posted by dunc View Post
Sort of related - I have a bunch of stories which I want to use - but all the lines are double spaced

Is there a way of clearing all empty lines using php...
try this

PHP Code:
<?php
  $contents 
file_get_contents("filename.txt");
  
$line_by_line explode("\n"$contents);
  
array_pop($line_by_line); // get rid of the empty line at the end that explode creates
  
$results = array();

 
$counter 0;
  foreach (
$line_by_line as $line) {
    if(
$counter == 0) {
       print 
"$line\n";
    }
    
$counter++;
  }

?>
Beaver Bob is offline   Reply With Quote
Old 2009-02-13, 10:30 PM   #5
dunc
You can now put whatever you want in this space :)
 
dunc's Avatar
 
Join Date: Feb 2007
Location: Australia
Posts: 658
Thanks Bob - perfect
dunc is offline   Reply With Quote
Old 2009-02-13, 10:33 PM   #6
Beaver Bob
Porn Blog Addict
 
Beaver Bob's Avatar
 
Join Date: Oct 2005
Location: Las Vegas, Nevada
Posts: 715
Send a message via ICQ to Beaver Bob
Quote:
Originally Posted by dunc View Post
Thanks Bob - perfect
actually cd34's is the better way, mine was going under the assumption that every other line was blank.. his checks if the line is blank or not.

theres usually millions of ways you can accompilsh the same thing with programming.
Beaver Bob is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:37 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc