FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » which command to use
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
which command to use [message #177274] Sat, 03 March 2012 13:26 Go to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
I have a page with nested <ul>'s.
I want the script to tell me how many there are.
so what command or function would I use?
Re: which command to use [message #177276 is a reply to message #177274] Sat, 03 March 2012 13:59 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 03-03-2012 14:26, richard wrote:
> I have a page with nested <ul>'s.
> I want the script to tell me how many there are.
> so what command or function would I use?

+
Re: which command to use [message #177278 is a reply to message #177274] Sat, 03 March 2012 14:08 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 3/3/2012 8:26 AM, richard wrote:
> I have a page with nested<ul>'s.
> I want the script to tell me how many there are.
> so what command or function would I use?

Fido, count!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: which command to use [message #177279 is a reply to message #177276] Sat, 03 March 2012 14:10 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 03-03-2012 14:59, Luuk wrote:
> On 03-03-2012 14:26, richard wrote:
>> I have a page with nested <ul>'s.
>> I want the script to tell me how many there are.
>> so what command or function would I use?
>
> +

or:
$file = file_get_contents('test.php');
echo substr_count($file, '<ul>');


or, start Googling for:
"I want a php script to tell me how many occurences of a string there
are in a file"
but leave out the unimportant parts of the question like:
" I want" and "to tell me"

so, Google for:
"php script how many occurences of a string there are in a file"
the first occurance is the RTFM of the *substr_count* function.
Re: which command to use [message #177280 is a reply to message #177274] Sat, 03 March 2012 14:56 Go to previous messageGo to next message
Beauregard T. Shagnas is currently offline  Beauregard T. Shagnas
Messages: 154
Registered: September 2010
Karma: 0
Senior Member
richard the sto0pid wrote:

> I have a page with nested <ul>'s.
> I want the script to tell me how many there are. so what command or
> function would I use?

Naturally, you want to know how many <ul> there are in the generated
HTML, of course. That would be the "page." <ul> in a script can/could be
generated within a loop, with just one <ul> actually existing in the
script. (something else from dynamicdrive, I'll wager)

Drop your HTML output into any competent text editor and use the Find
function, usually Control-F. Sometimes, even the browser can tell you!!

--
-bts
-This space for rent, but the price is high
Re: which command to use [message #177283 is a reply to message #177280] Sat, 03 March 2012 16:39 Go to previous messageGo to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
On Sat, 3 Mar 2012 14:56:54 +0000 (UTC), Beauregard T. Shagnasty wrote:

> richard the sto0pid wrote:
>
>> I have a page with nested <ul>'s.
>> I want the script to tell me how many there are. so what command or
>> function would I use?
>
> Naturally, you want to know how many <ul> there are in the generated
> HTML, of course. That would be the "page." <ul> in a script can/could be
> generated within a loop, with just one <ul> actually existing in the
> script. (something else from dynamicdrive, I'll wager)
>
> Drop your HTML output into any competent text editor and use the Find
> function, usually Control-F. Sometimes, even the browser can tell you!!

I'm not looking to see how many ul's are on a page for a personal
referencce. But rather, as a need for the rest of the script to know how
many items must be in an array.
As the basis for building a tree style menu.

While you may consider dynamicdrive a joke, at least they help.
I had a question about a script and they answered with the proper answer
without any bullshit like you give.

www.1littleworld.net/sample

All done with script provided by dynamicdrive and the lightbox script was
from elsewhere. With a modification made by a guy so that the script would
work as I wanted.

Before you go mouthing off about the errors, those are in the javascript,
not the html.
Re: which command to use [message #177284 is a reply to message #177283] Sat, 03 March 2012 17:25 Go to previous messageGo to next message
Beauregard T. Shagnas is currently offline  Beauregard T. Shagnas
Messages: 154
Registered: September 2010
Karma: 0
Senior Member
richard the sto0pid wrote:

> Beauregard T. Shagnasty wrote:
>> richard the sto0pid wrote:
>>> I have a page with nested <ul>'s.
>>> I want the script to tell me how many there are. so what command or
>>> function would I use?
>>
>> Naturally, you want to know how many <ul> there are in the generated
>> HTML, of course. That would be the "page." <ul> in a script can/could
>> be generated within a loop, with just one <ul> actually existing in the
>> script. (something else from dynamicdrive, I'll wager)
>>
>> Drop your HTML output into any competent text editor and use the Find
>> function, usually Control-F. Sometimes, even the browser can tell you!!
>
> I'm not looking to see how many ul's are on a page for a personal
> referencce. But rather, as a need for the rest of the script to know how
> many items must be in an array.
> As the basis for building a tree style menu.

There are two <ul> on your /sample page.

> While you may consider dynamicdrive a joke, at least they help. I had a
> question about a script and they answered with the proper answer without
> any bullshit like you give.
>
> www.1littleworld.net/sample

Yup. two of 'em.

> All done with script provided by dynamicdrive and the lightbox script
> was from elsewhere. With a modification made by a guy so that the script
> would work as I wanted.

Have you ever tried to write a script on your own?

> Before you go mouthing off about the errors, those are in the
> javascript, not the html.

Are you inviting an error report? Some of them would go away if you
would use HTML 4.01 instead of XHTML (which is a dead no-future doctype).
There are also several errors in your CSS.

Why are you asking about JavaScripts in a PHP group?

--
-bts
-This space for rent, but the price is high
Re: which command to use [message #177286 is a reply to message #177284] Sun, 04 March 2012 00:47 Go to previous messageGo to next message
Evan Platt is currently offline  Evan Platt
Messages: 124
Registered: November 2010
Karma: 0
Senior Member
On Sat, 3 Mar 2012 17:25:55 +0000 (UTC), "Beauregard T. Shagnasty"
<a(dot)nony(dot)mous(at)example(dot)invalid> wrote:

> Why are you asking about JavaScripts in a PHP group?

Because, they don't call him... oh you know where this is going.
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Re: which command to use [message #177291 is a reply to message #177274] Mon, 05 March 2012 09:02 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
El 03/03/2012 14:26, richard escribió/wrote:
> I have a page with nested<ul>'s.
> I want the script to tell me how many there are.
> so what command or function would I use?

The specs are too vague to provide a precise answer but the starting
point is the DOMDocument class:

http://es2.php.net/DOMDocument



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Re: which command to use [message #177293 is a reply to message #177283] Mon, 05 March 2012 09:24 Go to previous messageGo to next message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma: 0
Senior Member
On 3/3/2012 5:39 PM, richard wrote:
> On Sat, 3 Mar 2012 14:56:54 +0000 (UTC), Beauregard T. Shagnasty wrote:
>
>> richard the sto0pid wrote:
>>
>>> I have a page with nested<ul>'s.
>>> I want the script to tell me how many there are. so what command or
>>> function would I use?
>>
>> Naturally, you want to know how many<ul> there are in the generated
>> HTML, of course. That would be the "page."<ul> in a script can/could be
>> generated within a loop, with just one<ul> actually existing in the
>> script. (something else from dynamicdrive, I'll wager)
>>
>> Drop your HTML output into any competent text editor and use the Find
>> function, usually Control-F. Sometimes, even the browser can tell you!!
>
> I'm not looking to see how many ul's are on a page for a personal
> referencce. But rather, as a need for the rest of the script to know how
> many items must be in an array.
> As the basis for building a tree style menu.
>
> While you may consider dynamicdrive a joke, at least they help.
> I had a question about a script and they answered with the proper answer
> without any bullshit like you give.
>

Richard,

I fail to see why you respond so unfriendly ("bullshit like you give")
to Beauregard T. Shagnasty.
Maybe you had some problems with him before, but the answer he gave gave
you in this thread is correct and helpful.

I don't imagine I am the police in here, but I just want to warn you
that behaving aggressive will only result in your disadvantage: people
won't be inclined to help.
Just saying...

Regards,
Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
Re: which command to use [message #177294 is a reply to message #177293] Mon, 05 March 2012 09:43 Go to previous messageGo to next message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma: 0
Member
Am 2012-03-05 10:24, Erwin Moller meinte:

> Richard,
>
> I fail to see why you respond so unfriendly ("bullshit like you give")
> to Beauregard T. Shagnasty.
> Maybe you had some problems with him before, but the answer he gave gave
> you in this thread is correct and helpful.
>
> I don't imagine I am the police in here, but I just want to warn you
> that behaving aggressive will only result in your disadvantage: people
> won't be inclined to help.
> Just saying...

richard is a moron. Search this group. He frequently pops up with some
inane question and gets personal both when people try to help or tell
him (politely) to do his homework (and/or bugger off).

Gregor
Re: which command to use [message #177296 is a reply to message #177293] Mon, 05 March 2012 14:41 Go to previous messageGo to next message
Evan Platt is currently offline  Evan Platt
Messages: 124
Registered: November 2010
Karma: 0
Senior Member
On Mon, 05 Mar 2012 10:24:05 +0100, Erwin Moller
<erwinmollerusenet(at)xs4all(dot)nl> wrote:

> Richard,
>
> I fail to see why you respond so unfriendly ("bullshit like you give")
> to Beauregard T. Shagnasty.
> Maybe you had some problems with him before, but the answer he gave gave
> you in this thread is correct and helpful.

That's typical of a response from richard. Expect nothing less.
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Re: which command to use [message #177319 is a reply to message #177293] Fri, 09 March 2012 06:18 Go to previous message
Evan Platt is currently offline  Evan Platt
Messages: 124
Registered: November 2010
Karma: 0
Senior Member
On Mon, 05 Mar 2012 10:24:05 +0100, Erwin Moller
<erwinmollerusenet(at)xs4all(dot)nl> wrote:

> Richard,
>
> I fail to see why you respond so unfriendly ("bullshit like you give")
> to Beauregard T. Shagnasty.
> Maybe you had some problems with him before, but the answer he gave gave
> you in this thread is correct and helpful.

That's typical of a response from richard. Expect nothing less.
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: multiple dynamic text fields
Next Topic: combobox
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 17:05:14 GMT 2024

Total time taken to generate the page: 0.03097 seconds