Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    සිංහල යුනිකෝඩ් characters තියෙන slug එකක් හදාගන්නේ කොහොමද?

    Programming
    javascript web development
    2
    3
    470
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U
      ushanmithma last edited by

      article title එක සිංහල වලින් තිබුණම ඒක slug එකට convert වෙද්දීං සිංහල characters ඔක්කොම replace වෙනවා

      https://gist.github.com/mathewbyrne/1280286

      Advance Regular Expression ගැන දැනීමක් නෑ 🙊

      1 Reply Last reply Reply Quote 0
      • kasun viduranga
        kasun viduranga last edited by

        මේක PHP වලින් හදපු එකක් බලලා පුළුවන්නම් idea එකක් ගන්න. මගේ වැඩේටනම් හරි ගියා
        <?php
        //friendly URL conversion
        function to_prety_url($string){

        $string = str_replace("\\", '-', $string);
        $string = str_replace("~", '-', $string);
        $string = preg_replace('/[\s-]+/', '-', $string);
        $string = str_replace('/', '-', $string);
        $string = preg_replace("/[\s-]+/", " ", $string);
        $string = preg_replace("/[\s_]/", "-", $string);
        $string = preg_replace('/\s+/', '-', $string);
        $string = preg_replace('/-+/', '-', $string);
        

        return $string;
        }
        ?>

        U 1 Reply Last reply Reply Quote 1
        • U
          ushanmithma @kasun viduranga last edited by

          @kasun-viduranga 😯 Thank you thank you 🤝

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post

          0
          Online

          3.7k
          Users

          1.3k
          Topics

          5.3k
          Posts

          • Privacy
          • Terms & Conditions
          • Donate

          © Copyrights and All right reserved Lanka Developers Community

          Powered by Axis Technologies (PVT) Ltd

          Made with in Sri Lanka

          | |