Most people is pretty quiet right about now. Me, I see a stiff -- one I didn't have to kill myself -- I just get, the urge to, you know, do stuff. Like work out, run around, maybe get some trim if there's a willin' woman about... not that I get flush from corpses or anything. I ain't crazy.

Jayne ,'The Message'


Buffistas Building a Better Board  

Do you have problems, concerns or recommendations about the technical side of the Phoenix? Air them here. Compliments also welcome.

To-do list


Jesse - Nov 18, 2002 8:14:06 pm PST #1607 of 10000
Sometimes I trip on how happy we could be.

This may not be at all relevant, but I'm curious: how come, when you forget the last " in an a href thingie (which I just did), it messes up the way the page displays, but if you use a ' instead, it breaks everything?


Typo Boy - Nov 18, 2002 8:31:03 pm PST #1608 of 10000
Calli: My people have a saying. A man who trusts can never be betrayed, only mistaken.Avon: Life expectancy among your people must be extremely short.

Just not allowing the post would a be a bit easier. But since it is John's preference and John is doing the coding that is not a determining option.


John H - Nov 18, 2002 8:32:07 pm PST #1609 of 10000

In both cases, the link HREF contains everything up to the next whatever-it-is.

So the page where you put HREF=" and fail to close it will be missing everything up to the next double-quote and bracket, and the page where you put HREF=' and fail to close it will be missing everything up to the next single-quote and bracket.

I don't know why one should be worse than the other though, just a matter of where Jon's use single and where he's used double quotes.


§ ita § - Nov 18, 2002 8:32:29 pm PST #1610 of 10000
Well not canonically, no, but this is transformative fiction.

John's doing the coding? Yay!


Hil R. - Nov 18, 2002 8:33:02 pm PST #1611 of 10000
Sometimes I think I might just move up to Vermont, open a bookstore or a vegan restaurant. Adam Schlesinger, z''l

This may not be at all relevant, but I'm curious: how come, when you forget the last " in an a href thingie (which I just did), it messes up the way the page displays, but if you use a ' instead, it breaks everything?

I think that the post that broke everything had a ' instead of a " for the first quote, not the last one.


John H - Nov 18, 2002 8:34:32 pm PST #1612 of 10000

John is doing the coding

Ooh, am I? Scary. I'm just kind of sketching out code, I'm not necessarily thinking I'll be coding the whole interface thing. I just kind of started playing with it because it's a regular-expression type thing.

I was imagining that, like with quick-edit, I'd give ita a chunk of code to insert into the main body of the Board.


Jon B. - Nov 18, 2002 8:47:43 pm PST #1613 of 10000
A turkey in every toilet -- only in America!

I don't know why one should be worse than the other though, just a matter of where Jon's use single and where he's used double quotes.

Double quotes appear more often than single quotes, so using a single quote to start a link and not closing it properly is likely to affect more of the page than if you start a link with a double-quote and don't close it properly.


John H - Nov 19, 2002 1:29:43 am PST #1614 of 10000

Hey, anyone, what's the correct way to get the last item of an array in PHP? I can't seem to see it in the online manual -- should I just use

$array_name[count($array_name)]
or what? It looks clunky.


Typo Boy - Nov 19, 2002 7:09:08 am PST #1615 of 10000
Calli: My people have a saying. A man who trusts can never be betrayed, only mistaken.Avon: Life expectancy among your people must be extremely short.

Hey, anyone, what's the correct way to get the last item of an array in PHP? I can't seem to see it in the online manual -- should I just use
$array_name[count($array_name)] or what? It looks clunky.

$value = end ($array);

There are some nice array navigation commands in PHP. end($array) resests the internal pointer PHP maintains for each array to the last element of $array and returns the value.

reset($array) resets internal pointer to first element of array, and returns the value of that first element.

current($array) returns the value element of the array to which the pointer is set.

next($array) advances the pointer and returns the value of the resulting element.

each($array) returns the current element, then advances the pointer.

so next() and each() are differentways of navigating an array forward.

prev($array) decrements the pointer by 1, and returns to the new current element.

Also, if you have not used it, look up array_walk(). Basically a for next loop specifically for arrays.

Also, I assume you know that in PHP an array does not have to be accesed by number. You set up an associative array as follows:

$myrRecord=array("LastName"="Horner", "FirstName"="John", "Company"="ThatAussieNetwork");

Then use the extract function as follows:

extract($myrecord);

You will now have a scaler variable LastName with a value of Horner and so forth.

So: echo $LastName $FirstName $Company ;

will return

Horner John ThatAussieNetwork

You don't have to use the extract() function of course. You can access the array directly by index values rather than number.

echo $MyRecord["LastName"] $MyRecord["FirstName"] $MyRecord["Company"] ;

will also display;

Horner John ThatAussieNetwork


Jon B. - Nov 19, 2002 7:55:38 am PST #1616 of 10000
A turkey in every toilet -- only in America!

Actually, in both cases, it will display

Horner John ThatAussieNetwork

t /nitpick