Jump to content

Drompo2

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Everything posted by Drompo2

  1. I have a function that grabs the title from a li and split what ever the title up that is seperated by a '|' function RemoveFunction(data) { var get = $(data).attr("class"); var getitem = $(data).closest("li"); var cat = $(getitem).attr("title"); console.log($(cat)); var cats = cat.split('|'); This just returns blank on console, but yet console.log($(getitem).attr("title")); Outputs correctly in console :s Any ideas?
  2. Ah yeah of course, it doesnt matter then, was just an after thought i had
  3. Yeah i had tried a similar solution to that, its just that it then outputs everything on different lines
  4. That works brilliently, thank you Sorry to be a pain, dont suppose there is away to find a ward if there is a gap inbetween. For example 'Mass election' would find mass, election but also selection
  5. Right, i will try that. And because It takes the first character as posistion 0, and then the second character as position 1. Therefore the word hat is found at Position 1.
  6. See thats a completely different story, you can use the in_array function Thanks for the quick reply, I know that it exists in the array, thats the point i have got upto, its displaying the word above the string to show it contains other words that im stuck on :/ For example... swords <-- Containing word, Had to go on another line because of clash man <-- Containing word swordsman <-- String sword <-- Containing word
  7. Sorry about the vagueness. It is searching for words in the string that contain other words. For example, 'That' contains 'hat', and 'at'. 'Swordsman' contains 'Sword', 'Swords', 'words', 'man' The Array Number was slightly off for some reason too Array ( [0] => 0|That [1] => 1|hat[2] =>2|at [3] => 14|That [4] => 15|hat [5] =>16|at [6] => 18|Cat [7] => 19|at [8] => 28|swordsman [9] => 28|sword [10] => 28|swords [11] => 34|man) Does that help you anymore? Any help much appreciated
  8. I have an Array of data of words and where they are positioned in a string of data. Array ( [0] => 0|That [1] => 1|hat[2] =>2|at [3] => 13|That [4] => 14|hat [5] =>15|at [6] => 18|Cat [7] => 19|at [8] => 28|swordsman [9] => 28|sword [10] => 28|swords [11] => 34|man) Is there anyway to display these words above/below the string in the correct position?
  9. Managed to solve previous post.
  10. Yeah i understand your code, just trying to adapt it in to what i'm building, as the variables come in, in an array, using a forloop to seperate each one and then run your code to change the wildcards. Is there anyway to add the combinations back on to the orignal array? $string = $_POST["string"]; if ($string){ foreach ($string as $str){ $spec = array( 'Y' => array('A','B'), 'M' => array('A','B','C') ); $combos = getCombos( $str, $spec); print_r( $combos ); } }
  11. Works Perfectly, Thank you ever so much! Been doing PHP for years and i couldnt get my head around this at all.
  12. Yeah i assumed it would contain many loops, check for each instance. Thank you for your time
  13. If a user entered string is ABYABM and Y can mean A or B and M can be A, B or C The string could be ABAABA ABBABA ABAABB ABBABB ABAABC ABBABC
  14. Been trying to solve this problem for a while now, but have got nowhere. If a user enters a string that contains certian ambigious characters, eg. Y, M, D It replaces them with non-ambigious characters, this being a simple preg_replace function. But each letter (Y,M,D) has multiple non-ambigious characters, therefore could have several different combinations. Any help at all very appreciated. Ashley
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.