จะ gen keyword แบบนี้ยังไงครับ

เริ่มโดย oabb, 14 สิงหาคม 2015, 12:07:46

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

oabb

1234 ให้ออกมาเป็นลิสที่มีเลข 1234 ทั้งหมด

เช่น
1234
1324
1423
2134
3214

จนสุด

ไม่มีเบิ้ล เช่น1123

ผมลอง http://tools.seobook.com/spelling/keywords-typos.cgi ก็ไม่ได้ตามต้องการ

ต้องใช้โปรแกรมอะไร หรือวิธีใหนแนะนำหน่อยครับ


[direct=http://mosh.co.th/].[/direct][direct=http://meenny.com].[/direct]

dualkore

ลองค้นหาคำว่า permutations ที่ GG ดูครับใช้ภาษาอะไรเขียนก็ต่อท้ายเอาครับ
คนเรามีความพยายามเท่ากันแต่...ใช้ไม่เท่ากัน

smapan


function permute($str) {
    /* If we only have a single character, return it */
    if (strlen($str) < 2) {
        return array($str);
    }

    /* Initialize the return value */
    $permutations = array();

    /* Copy the string except for the first character */
    $tail = substr($str, 1);

    /* Loop through the permutations of the substring created above */
    foreach (permute($tail) as $permutation) {
        /* Get the length of the current permutation */
        $length = strlen($permutation);

        /* Loop through the permutation and insert the first character of the original
        string between the two parts and store it in the result array */
        for ($i = 0; $i <= $length; $i++) {
            $permutations[] = substr($permutation, 0, $i) . $str[0] . substr($permutation, $i);
        }
    }

    /* Return the result */
    return $permutations;
}


เอาไปใช้
$str = "1234";
$permutations = array_unique(permute($str));


...ไม่ได้คิดเองนะฮ้าบบบ
https://cogo.wordpress.com/2008/01/08/string-permutation-in-php/
[direct=http://cp.siamhostweb.com/cart.php?gid=1]จูมล่าโฮส สยามโฮสเว็บ[/direct] [direct=http://www.modty.com]modty.com[/direct]
[direct=http://www.apartment.in.th]รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง[/direct]
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***

oabb

อ้างถึงจาก: smapan ใน 14 สิงหาคม 2015, 13:59:07

function permute($str) {
    /* If we only have a single character, return it */
    if (strlen($str) < 2) {
        return array($str);
    }

    /* Initialize the return value */
    $permutations = array();

    /* Copy the string except for the first character */
    $tail = substr($str, 1);

    /* Loop through the permutations of the substring created above */
    foreach (permute($tail) as $permutation) {
        /* Get the length of the current permutation */
        $length = strlen($permutation);

        /* Loop through the permutation and insert the first character of the original
        string between the two parts and store it in the result array */
        for ($i = 0; $i <= $length; $i++) {
            $permutations[] = substr($permutation, 0, $i) . $str[0] . substr($permutation, $i);
        }
    }

    /* Return the result */
    return $permutations;
}


เอาไปใช้
$str = "1234";
$permutations = array_unique(permute($str));


...ไม่ได้คิดเองนะฮ้าบบบ
https://cogo.wordpress.com/2008/01/08/string-permutation-in-php/

ขอรบกวนอีกนิสนึง คือใช้ยังไงครับ ผมไม่เป็นเลย  ขอบคุณมากครับ
[direct=http://mosh.co.th/].[/direct][direct=http://meenny.com].[/direct]

oabb

[direct=http://mosh.co.th/].[/direct][direct=http://meenny.com].[/direct]

smapan

อ้างถึงจาก: oabb ใน 14 สิงหาคม 2015, 15:24:14
อ้างถึงจาก: smapan ใน 14 สิงหาคม 2015, 13:59:07

function permute($str) {
    /* If we only have a single character, return it */
    if (strlen($str) < 2) {
        return array($str);
    }

    /* Initialize the return value */
    $permutations = array();

    /* Copy the string except for the first character */
    $tail = substr($str, 1);

    /* Loop through the permutations of the substring created above */
    foreach (permute($tail) as $permutation) {
        /* Get the length of the current permutation */
        $length = strlen($permutation);

        /* Loop through the permutation and insert the first character of the original
        string between the two parts and store it in the result array */
        for ($i = 0; $i <= $length; $i++) {
            $permutations[] = substr($permutation, 0, $i) . $str[0] . substr($permutation, $i);
        }
    }

    /* Return the result */
    return $permutations;
}


เอาไปใช้
$str = "1234";
$permutations = array_unique(permute($str));


...ไม่ได้คิดเองนะฮ้าบบบ
https://cogo.wordpress.com/2008/01/08/string-permutation-in-php/

ขอรบกวนอีกนิสนึง คือใช้ยังไงครับ ผมไม่เป็นเลย  ขอบคุณมากครับ

หน้องนี้ Programming ...
สำหรับ Programmer ผู้สนใจในการพัฒนา Application , Script , ปั่นเว็บ , ทำ SEO แบบต่างๆ ....... ปวดหมอง ไข้ขึ้น แก้ปัญหาไม่ตก ปรึกษาเพื่อนๆชาว Programmer ด้วยกันได้ที่นี่เลย (เน้นเขียนโปรแกรมถ้าแจกโปรแกรมไปห้อง tool)

:P

ถ้าจะหา Tools น่าจะผิดห้องนะครับ
[direct=http://cp.siamhostweb.com/cart.php?gid=1]จูมล่าโฮส สยามโฮสเว็บ[/direct] [direct=http://www.modty.com]modty.com[/direct]
[direct=http://www.apartment.in.th]รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง[/direct]
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***

dualkore

#6
ผมก็งงตั้งแต่ไม่บอกว่าใช้ภาษาอะไรพัฒนา ก็นึกว่าจะหา code กลายเป็นหา tools    :-X
หรือเป็นเพราะผมอ่านคำถามไม่ดีเอง 555
คนเรามีความพยายามเท่ากันแต่...ใช้ไม่เท่ากัน

smapan

อ้างถึงจาก: dualkore ใน 14 สิงหาคม 2015, 16:29:48
ผมก็งงตั้งแต่ไม่บอกว่าใช้ภาษาอะไรพัฒนา ก็นึกว่าจะหา code กลายเป็นหา tools    :-X
หรือเป็นเพราะผมอ่านคำถามไม่ดีเอง 555

ผมก็ค้นไปจนมึน เพราะนึกไม่ออกว่าต้องใช้ คำสั่งไหนเขียนเช่นกัน
:wanwan004: :wanwan004: :wanwan004:

เอาเป็นว่าคราวนี้จะใช้ spin ไม่ต้องไปค้นละ หาเองตอบเองเอาไว้แล้ว bookmark ไว้เลย

:wanwan024:
[direct=http://cp.siamhostweb.com/cart.php?gid=1]จูมล่าโฮส สยามโฮสเว็บ[/direct] [direct=http://www.modty.com]modty.com[/direct]
[direct=http://www.apartment.in.th]รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง[/direct]
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***