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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-20-2004, 06:30 PM   #1
Smut
Confirmed User
 
Join Date: Sep 2002
Posts: 654
PHP Code Syntax (help please)

Here's what I'm wanting to do...

I have a little script that outputs a few parts in 1 string...
Example:

Form input:
Name
ICQ
Email

The script writes the data to file in the format of:
bob jones:5551212:[email protected]

Seperated with the ":".

Now, I'm trying to display each line on a seperate page formatted like so:

Name: Bob Jones
ICQ: 5551212
Email: [email protected]


I know there's something with the explode() function, or split()... but, not exactly sure if this is the best way to do it, and if it is, I'm not quite sure of the syntax.

Any help is appreciated.

Thanks
Smut is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-20-2004, 06:34 PM   #2
JSA Matt
So Fucking Banned
 
Join Date: Aug 2003
Location: San Diego, CA
Posts: 5,464
PHP Code:
<?php
//    List

    
$data file("file.txt");
    
    if (
count($data) < 0)    {
        for (
$i 0$i count($data); $i++)    {
            list(
$name,$icq,$email) = explode(":"$data[$i]);
            
            echo 
"Name: " $name "<BR>";
            echo 
"ICQ: " $icq "<BR>";
            echo 
"Email: " $email "<BR><BR>";
        }
    } else {
        echo 
"Data File Empty";
    }
?>
JSA Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-20-2004, 08:11 PM   #3
Smut
Confirmed User
 
Join Date: Sep 2002
Posts: 654
Quote:
Originally posted by JSA Matt
PHP Code:
<?php
//    List

    
$data file("file.txt");
    
    if (
count($data) < 0)    {
        for (
$i 0$i count($data); $i++)    {
            list(
$name,$icq,$email) = explode(":"$data[$i]);
            
            echo 
"Name: " $name "<BR>";
            echo 
"ICQ: " $icq "<BR>";
            echo 
"Email: " $email "<BR><BR>";
        }
    } else {
        echo 
"Data File Empty";
    }
?>
Great! Thanks! That's what I was looking for.
Smut is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.