473,324 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Array help?

I have this glossary that was setup and I want to modify a bit.
Here's how...

##############################
printf($getWordArray["word"]);
echo "</b></dt><dd>";
printf($getWordArray["definition"]);
echo "</dd><br>";
}
##############################

It out puts text like this...

##############################
Term
Definition here here here here here here here here here here
here here here here here here here here.
##############################

The whole idea is to have a sweet looking glossary like nobody else
has done....here's my idea. I want the script to check the definition
value BEFORE it's output to the browser window, and "look for" the
"term" value to see if exists. If yes, then link the term to it's own
special link such as that listed below...

I want it to actually CHECK the $definition variable for the instance
of ANY of $word variables in the database table. If yes, then link
the word on output to be like this (where "underwriting" is the word
that was recognized):

##############################
http://www.my-domain.com/glossary/gl...d=underwriting
.....this would link to the term underwriting
##############################

Can u help?? I know all you guys are smart as hell out there....I'm
just a newbie.

Thanks,
William Ashworth
Jul 16 '05 #1
1 2005
William Ashworth wrote:
I have this glossary that was setup and I want to modify a bit.
Here's how...

##############################
printf($getWordArray["word"]);
echo "</b></dt><dd>";
printf($getWordArray["definition"]);
echo "</dd><br>";
}
##############################

It out puts text like this...

##############################
Term
Definition here here here here here here here here here here
here here here here here here here here.
##############################

The whole idea is to have a sweet looking glossary like nobody else
has done....here's my idea. I want the script to check the definition
value BEFORE it's output to the browser window, and "look for" the
"term" value to see if exists. If yes, then link the term to it's own
special link such as that listed below...

I want it to actually CHECK the $definition variable for the instance
of ANY of $word variables in the database table. If yes, then link
the word on output to be like this (where "underwriting" is the word
that was recognized):

##############################
http://www.my-domain.com/glossary/gl...d=underwriting
....this would link to the term underwriting
##############################


You mean that, if a term on a page shows up in the glossay, you want it to
link to the glossary? Something like Astronomy.com does
(http://astronomy.com/Content/Dynamic...407vgebk.asp)?

If so, and if your page text is coming from a database, you could
explode() your page text with a space, or other non-alpahbetic character,
then print each word individually, using isset() before you do to see if
it's in the array. If it is, write the anchor tag, print the word, then
close the anchor tag. You might want to unset() the array elements as
they're used, to avoid, say, 50 links to "underwriting" in the same page
(Astronomy.com does this). In this case, only the first instance would be
linked.

I'm not sure how efficient this method would be for long articles - use
caution.

Also note the drawbacks of automatically linking - links can sometimes be
out of context. For example, the sentence "Sagan was seeing Druyan for
several years before they married." on Astronomy.com would link "seeing"
to the astronomical definition, which refers to atmospheric conditions.

Good luck,
Shawn (in no way associated with Astronomy.com) :o)
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: point | last post by:
Hi there.. I have the folowing array => property = hexonet => property = 2003-12-01 18:46:20.0 => property = hexonet => property = 2003-12-02 02:59:15.0 => property = hexonet =>...
2
by: Antti Nummiaho | last post by:
Consider the following javascript: var temp = new Array(new Array(0)) document.writeln(temp) temp = new Array(new Array(0,1)) document.writeln(temp) One would assume that it would print "0...
8
by: Gactimus | last post by:
I made the program below. It outputs the smallest number in the array. What I would like to know is how do I output the array location. I am at a loss. For example, since the smallest number in...
7
by: ritchie | last post by:
Hi all, I am new to this group and I have question that you may be able to help me with. I am trying to learn C but am currently stuck on this. First of all, I have a function for each sort...
5
by: ritchie | last post by:
Hi, I am writing to ask if anyone can see why my array is not being sorted correctly? It's an array of 4 elements(ints 1,2,3,4) but after calling the selection sort it comes back sorted as...
8
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to...
3
by: George | last post by:
Sub ExcelToListBox() Dim xRange As Object Dim ary Dim xValue As String xRange = oXL.Range("A1:A9") 'has letters A-H ary = xRange.value xValue = ary(3, 1) 'xValue = C...
3
by: inkexit | last post by:
I need help figuring out what is wrong with my code. I posted here a few weeks ago with some code about creating self similar melodies in music. The coding style I'm being taught is apparently a...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
5
by: fluk | last post by:
Hi Guys, I hope someone can help me with this, because i'm getting crazy to find a good way to do that! This is what I got by querying a db. $arr1 = array("site", "description", "area1" ,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.