php - Adding code to every character within a string -


i need create 'word search' puzzle, if hover on word, changes colour, can find ease. that, have split searching part , words in separate arrays. want add x every character, 'x' being random character.

i have no knowledge of codes can me achieve this.

a part of puzzle:

-e-------------a--e-

-k--galabal---a---l-

-e-----------t----t-

-n-straatlantaarn-o-

-diuleg-----------u-

----kade----------w-

computer------------

(without breaklines)

with computer, galabal, straatlantaarn, geluid, kade , others words need searched. puzzle 20 x 20 characters.

i try point in right direction, without spoon-feeding code.

heres algorithm.

  1. use explode whitespace character delimiter split words of string array.
  2. loop through array elements , start creating html output.
  3. for each word, prepend <span class="word-highlight">.
  4. and append each word </span>
  5. remember append whitespace while re-creating sentence.
  6. also keep logic handles full stops , pronouns etc handy.
  7. now write css code handle :hover event of mouse on respective class (.word-highlight in our case), , subsequently change color.

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -