if true go to next line

This is a discussion on "if true go to next line" within the PHP Forum section. This forum, and the thread "if true go to next line are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 8th, 2007, 17:18
Up'n'Coming Member
Join Date: Oct 2007
Location: london
Age: 25
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb if true go to next line

Hi,

Im looking for a function that allows me to get to the nest line of a file that is read if something is true eg...

PHP: Select all

        $fp fopen($filename"r"); //Open the server log
        
$content fread($fpfilesize($filename));     // Read the server log    
        
$content explode("\n"$content); // explode into array    
        
$content  array_reverse($content ); // reverse the array

$a 2;
if (
$a <'then goto next line of file'){
then do some stuff in here}

else{} 
Can anyone help with this please??

Thanks. Eon201
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 8th, 2007, 17:39
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: if true go to next line

Are you in a loop? Like a foreach or while or for loop?

If you are, you can use continue;

PHP: Select all

if ('This is true')

    continue;
else
    
//do other stuff 
Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 8th, 2007, 20:50
Junior Member
Join Date: Nov 2007
Location: Norwich, UK
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: if true go to next line

Hi Eon,

Can you elaborate on what exactly you require the code to do? Do you want to skip the first line in a file or skip any particular line that meets a certain criteria?

James.
__________________
Digital Overload - a digital agency
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 9th, 2007, 07:32
Up'n'Coming Member
Join Date: Jun 2007
Location: Germany
Age: 23
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Re: if true go to next line

You wrote it
PHP: Select all

$a 2
if($a == 3)
{
  continue;
}else{
  
// modify a in some way here, or do anything you want..

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Line breaks alexgeek Other Programming Languages 1 Nov 1st, 2007 01:51
This is too true karinne Webforumz Cafe 5 Aug 13th, 2007 23:33
Line Break DregondRahl Web Page Design 6 Jun 12th, 2007 15:33
on-line training n1gel65 Starting Out 2 Jun 11th, 2007 16:27
i this true? abdghadir Web Page Design 7 Dec 12th, 2006 11:49


All times are GMT. The time now is 18:11.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42