470,821 Members | 1,995 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

HTML tables

I'm new to php and i need ur help.

I have HTML table that is made form 4 columns and x rows.

I am wondering if there is any function that could get data from specific
cell into variable?

Example:

I have some variable $var and i would like to put data from some cell x,y
into that variable.

Can someone help me?

Mar 4 '06 #1
5 1172
Netko wrote:
I'm new to php and i need ur help.

I have HTML table that is made form 4 columns and x rows.

I am wondering if there is any function that could get data from specific
cell into variable?

Example:

I have some variable $var and i would like to put data from some cell x,y
into that variable.

Can someone help me?


Take a look at SimpleXML. As long as you are writing your pages in
XHTML, this should do exactly what you want.

--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
Mar 4 '06 #2
Once you output the data to the browser, you can't access it using PHP.

If you want to change the table after its been outputted, use
javascript (and ask in the appropriate group)

If you are storing the table in an array, then to access a specific
cell you would just do:
$var = $table_data[2][1]; // this accesses row 3, column 2 (because
zero is the starting row or column)

Mar 4 '06 #3
Richard Levasseur wrote:
Once you output the data to the browser, you can't access it using PHP.


My assumption was that he wanted to access the HTML before it was
spitted to the browser (such as buffering).
--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
Mar 4 '06 #4
Datuma 4 Mar 2006 11:12:39 -0800, Richard Levasseur je napisao\la:
Once you output the data to the browser, you can't access it using PHP.

If you want to change the table after its been outputted, use
javascript (and ask in the appropriate group)


The table with data isnt output in browser, but it is html file on server.
But thx anyway, i think i got it with SimpleXML
Mar 4 '06 #5
On Sat, 04 Mar 2006 18:08:24 +0100, Netko wrote:
I'm new to php and i need ur help.

I have HTML table that is made form 4 columns and x rows.

I am wondering if there is any function that could get data from
specific cell into variable?

Example:

I have some variable $var and i would like to put data from some cell
x,y into that variable.

Can someone help me?

What you want is something like Perl HTML::TableParser module.
http://search.cpan.org/~djerius/HTML...TableParser.pm
Unfortunately, PHP doesn't have CPAN and you can try finding something on
http://www.phpclasses.org, write your own parser, which shouldn't be too
hard, or just write the whole darned thing in Perl.

--
http://www.mgogala.com

Mar 5 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

71 posts views Thread by tomy_baseo | last post: by
21 posts views Thread by BT | last post: by
59 posts views Thread by phil-news-nospam | last post: by
136 posts views Thread by 1001 Webs | last post: by
3 posts views Thread by codemannh | last post: by
15 posts views Thread by lxyone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.