Jump to content

zoombie

New Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by zoombie

  1. 10 hours ago, NotSunfighter said:

    You need to generate an HTML page with an INPUT for the user generated string then use a JAVASCRIPT function called Ajax to transfer user input to your PHP function and transfer the permutations back to JS to show them.

    Thank you so much for your reply,

     

    can you help me with code, i don't know how to do it,

    please kindly help me with example code please dear

    thank with best regard 

  2. Hi all dear
    can anyone help me how to find all permutation of a String by allow user input text or number and generate when user click on button,

    user need to input text on number in input box and click generate button to show result of all permutation of a String
    below is code i found from https://www.journaldev.com/526/permutation-of-string-in-java
    but it's not allow user input text,

    please help me in php function
    thank with best regard

     

    <!DOCTYPE html>
    <html>
    <body>
    <?php
    function generatePermutation($string,$start,$end){ if($start == $end-1){ echo "$string - "; } else{ for($i = $start; $i < $end; $i++){ $temp = $string[$start]; $string[$start] = $string[$i]; $string[$i] = $temp; generatePermutation($string,$start+1,$end); $temp = $string[$start]; $string[$start] = $string[$i]; $string[$i] = $temp; } }
    }
    $str = "ABC";
    $n = strlen($str);
    echo "All the permutations of the string are: ";
    generatePermutation($str,0,$n);
    ?>
    </body>
    </html>

     

×
×
  • 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.