Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 09-19-2009, 02:51 PM output numbered list
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
Hey guys
Here is my challenge.

if you go here
http://www.bmcoll.com/pagetest

and paste in some html then hit the submit button the result page will show the
code you entered the errors found and the code that has been cleaned to w3c xhtml 1.0

What I cant seem to figure out is this .
in the first box that displays the code you entered I want to number each line of code. and I can not seem to figure out how to take the input from the form set it as an array then explode it as output with each line numbered. or if that is even the correct approach.
Here is the basic code to display the code that the user posted
Code:
<?php

$file= $_POST['file'];

echo"<h3>Here is the html you started with</h3>";
echo"<textarea rows=\"10\"cols=\"90\">$file</textarea>";
It works fine but how do I display it as a numbered list.
__________________
I hope to build a site with something for every one

Please login or register to view this content. Registration is FREE
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
 
Register now for full access!
Old 09-19-2009, 03:54 PM Re: output numbered list
bmcoll3278's Avatar
Super Talker

Posts: 118
Name: Brian Collins
Trades: 0
I think I got it sorry to keep asking questions then finding the answer myself But I had tried several hours before asking. here is the code that worked
Code:
echo"<h3>Here is the html you started with</h3>";
echo"<span class=\"scrollArea\"ID=\"copytext\"><xmp>";
$file= $_POST['file'];
$blah = explode("\n", $file);     

for($i = 0; $i < count($blah); $i++){
	echo"$i:$blah[$i]\n";
}
echo"</xmp></span>";
Thanks for you guys that looked at this post to try to help!!!!
__________________
I hope to build a site with something for every one

Please login or register to view this content. Registration is FREE

Last edited by bmcoll3278; 09-19-2009 at 03:56 PM.. Reason: ad thankyou
bmcoll3278 is offline
Reply With Quote
View Public Profile Visit bmcoll3278's homepage!
 
Reply     « Reply to output numbered list
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09627 seconds with 12 queries