<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rabiul Islam on Medium]]></title>
        <description><![CDATA[Stories by Rabiul Islam on Medium]]></description>
        <link>https://medium.com/@rabiul-islam?source=rss-4ff0995c8d8a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AVyhAvT8rsfHpnTrL9vVag.jpeg</url>
            <title>Stories by Rabiul Islam on Medium</title>
            <link>https://medium.com/@rabiul-islam?source=rss-4ff0995c8d8a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 10:30:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rabiul-islam/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Code, Collaborate, Conquer: Navigating Development with Notion]]></title>
            <link>https://rabiul-islam.medium.com/notion-d406b87c9ee5?source=rss-4ff0995c8d8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d406b87c9ee5</guid>
            <category><![CDATA[notion-tips]]></category>
            <category><![CDATA[notion]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Rabiul Islam]]></dc:creator>
            <pubDate>Sun, 17 Dec 2023 02:54:47 GMT</pubDate>
            <atom:updated>2023-12-17T02:56:41.024Z</atom:updated>
            <content:encoded><![CDATA[<p>Notion is a flexible and cooperative productivity tool that integrates task management, document management, note-taking, and collaboration functionalities. Notion is renowned for its adaptability and capacity to adapt the workspace to the requirements of each member of the team or an individual. Even though it is free to use and offers an extensive range of opportunities, I will discuss how, from the perspective of a developer, it can be a truly amazing productivity tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4kAE0MZkdjvIjxGY" /><figcaption>Photo by <a href="https://unsplash.com/@teamnocoloco?utm_source=medium&amp;utm_medium=referral">Team Nocoloco</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Notion can be a powerful tool for developers, offering a flexible and collaborative workspace that can streamline various aspects of development. For me it’s a great tool that I can use it in my laptop, mobile and other devices. Here are several ways in which Notion can be truly effective for developers:</p><ol><li><strong>Documentation and Knowledge Base:</strong></li></ol><ul><li>Create a central repository for documentation, code snippets, and best practices. Embed code snippets directly into pages for quick reference.</li><li>Use Notion’s hierarchical structure to organize information by projects, languages, or frameworks. Utilize nested pages, headings, and subheadings to organize information.</li><li>Collaborate with team members on documentation and keep it up to date. Team members can see the central documentation for your project. That’s why it help a developer to keep updated.</li><li>As it facilitates real-time collaboration that’s why it would be a blessing for remote developer.</li></ul><p><strong>2. Project Management:</strong></p><ul><li>Timelines for projects, sprints, and tasks can be managed with Notion databases and boards.</li><li>Track bugs, feature requests, and user stories in a structured manner.</li><li>Integrate Gantt charts, Kanban boards, or calendars to see how projects are progressing.</li></ul><p><strong>3. Task Lists and Personal Productivity:</strong></p><ul><li>Maintain task lists for daily, weekly, or project-specific goals.</li><li>Use the ‘Reminders’ function to establish due dates and get alerts.</li><li>Integrate with calendar apps to synchronize project timelines.</li><li>Groups, status, and other criteria can be used to arrange tasks. You can also give other members tasks to complete.</li></ul><p><strong>4. Code Snippet Repository:</strong></p><ul><li>Use Notion to store and organize code snippets for easy retrieval.</li><li>Categorize snippets by programming languages, frameworks, or specific use cases.</li><li>Collaborate with team members by sharing and discussing code snippets.</li></ul><p><strong>5. Meeting Notes and Collaboration:</strong></p><ul><li>Keep meeting notes and collaborative discussions organized within Notion.</li><li>Share meeting agendas, minutes, and action items with team members.</li><li>Utilize comments and mentions for effective communication.</li></ul><p><strong>6. Integrations with Development Tools and Connections:</strong></p><ul><li>Link Notion with Jira, Slack, GitHub, and other development tools.</li><li>Embed live databases or boards directly into Notion from external tools.</li><li>Streamline workflows by automating certain tasks using third-party integrations.</li><li>Combine several connections, such as Bardeen, Census, Hightouch, Make, Marker, and so forth.</li></ul><p><strong>7. API Documentation and API Keys:</strong></p><ul><li>Document APIs and store API keys securely within Notion.</li><li>Use tables and relations to create structured documentation for different APIs.</li><li>Share API documentation with team members for easy reference.</li><li>Sometimes backend developers create APIs, which they can note down in their notions. After that, frontend developers can be effective from there.</li></ul><p><strong>8. Learning and Professional Development:</strong></p><ul><li>Create a space for continuous learning, including links to tutorials, articles, and resources.</li><li>Track professional development goals and achievements over time.</li><li>Store effective notes from your learning. It can be from video tutorial, live video class or etc.</li></ul><p><strong>9. Feedback and Reviews:</strong></p><ul><li>Use Notion for collecting feedback from team members or stakeholders.</li><li>Conduct reviews and keep a record of lessons learned for future use.</li><li>In the near future, a developer can show these reviews to the next client or project.</li></ul><p><strong>10. Custom Workflows and Templates:</strong></p><ul><li>Design custom workflows and templates tailored to your development processes.</li><li>Create reusable templates for project kick-offs, code reviews, and other recurring tasks.</li><li>Create different types of templates, like works, projects, school, wiki, personal, docs, etc.</li></ul><p><strong>11. Reusable command and codes:</strong></p><ul><li>Store your reusable codes or commands in a notion database.</li><li>As you choose, arrange them in a different sequence and status.</li></ul><p>By leveraging Notion effectively, developers can enhance collaboration, improve organization, and streamline various aspects of their workflow, ultimately leading to increased productivity and efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d406b87c9ee5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling PHP 8.3: Exploring the Latest Features and Enhancements]]></title>
            <link>https://rabiul-islam.medium.com/unveiling-php-8-3-exploring-the-latest-features-and-enhancements-e5130aa235a3?source=rss-4ff0995c8d8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5130aa235a3</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-new-features]]></category>
            <category><![CDATA[new-php-version]]></category>
            <category><![CDATA[latest-php]]></category>
            <category><![CDATA[laravel-php]]></category>
            <dc:creator><![CDATA[Rabiul Islam]]></dc:creator>
            <pubDate>Fri, 24 Nov 2023 04:58:09 GMT</pubDate>
            <atom:updated>2023-11-24T04:58:09.637Z</atom:updated>
            <content:encoded><![CDATA[<p>PHP 8.3, the latest version of the popular server-side scripting language, introduces a host of new features and improvements that elevate the developer experience. This version also introduces support for enumerations, providing developers with a cleaner and more expressive way to define a set of named values. With improvements in error handling and numerous optimizations, PHP 8.3 aims to empower developers by streamlining their workflows and enhancing the overall efficiency of PHP-based projects. Whether you are a seasoned PHP developer or just stepping into the realm of web development, PHP 8.3 promises a more robust and feature-rich environment for crafting modern and scalable applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WAhfOQsneIjVvN7U" /><figcaption>Photo by <a href="https://unsplash.com/@benofthenorth?utm_source=medium&amp;utm_medium=referral">Ben Griffiths</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>1. Typed class constants</strong></h3><p><strong>Old</strong></p><pre>interface I {<br>  // We may naively assume that the PHP constant is always a string.<br>  const PHP = &#39;PHP 8.2&#39;;<br>}<br><br>class Foo implements I {<br>  // But implementing classes may define it as an array.<br>  const PHP = [];<br>}</pre><p><strong>New</strong></p><pre>interface I {<br>  const string PHP = &#39;PHP 8.3&#39;;<br>}<br><br>class Foo implements I {<br>  const string PHP = [];<br>}<br>// Fatal error: Cannot use array as value for class constant<br>// Foo::PHP of type string</pre><h3><strong>2. Dynamic class constant fetch</strong></h3><p>Old</p><pre>class Foo {<br>  const PHP = &#39;PHP 8.2&#39;;<br>}<br><br>$searchableConstant = &#39;PHP&#39;;<br>var_dump(constant(Foo::class . &quot;::{$searchableConstant}&quot;));</pre><p><strong>New</strong></p><pre>class Foo {<br>  const PHP = &#39;PHP 8.3&#39;;<br>}<br><br>$searchableConstant = &#39;PHP&#39;;<br>var_dump(Foo::{$searchableConstant});</pre><h3><strong>3. Deep-cloning of readonly properties</strong></h3><p><strong>Old</strong></p><pre>class PHP {<br>  public string $version = &#39;8.2&#39;;<br>}<br><br>readonly class Foo {<br><br>public function __construct(<br>  public PHP $php<br>) {}<br><br>  public function __clone(): void {<br>    $this-&gt;php = clone $this-&gt;php;<br>  }<br>}<br><br>$instance = new Foo(new PHP());<br>$cloned = clone $instance;<br>// Fatal error: Cannot modify readonly property Foo::$php</pre><p><strong>New</strong></p><pre>class PHP {<br>  public string $version = &#39;8.2&#39;;<br>}<br><br>readonly class Foo {<br>  public function __construct(<br>    public PHP $php<br>  ) {}<br><br>  public function __clone(): void {<br>    $this-&gt;php = clone $this-&gt;php;<br>  }<br>}<br><br>$instance = new Foo(new PHP());<br>$cloned = clone $instance;<br>$cloned-&gt;php-&gt;version = &#39;8.3&#39;;</pre><h3><strong>4. New json_validate() function</strong></h3><p><strong>Old</strong></p><pre>function json_validate(string $string): bool {<br>  json_decode($string);<br>  return json_last_error() === JSON_ERROR_NONE;<br>}<br><br>var_dump(json_validate(&#39;{ &quot;test&quot;: { &quot;foo&quot;: &quot;bar&quot; } }&#39;)); // true</pre><p><strong>New</strong></p><pre>var_dump(json_validate(&#39;{ &quot;test&quot;: { &quot;foo&quot;: &quot;bar&quot; } }&#39;)); // true</pre><h3><strong>5. New Randomizer::getBytesFromString() method</strong></h3><p><strong>Old</strong></p><pre>// This function needs to be manually implemented.<br>function getBytesFromString(string $string, int $length) {<br>  $stringLength = strlen($string);<br>  $result = &#39;&#39;;<br><br>  for ($i = 0; $i &lt; $length; $i++) {<br>    // random_int is not seedable for testing, but secure.<br>    $result .= $string[random_int(0, $stringLength - 1)];<br>  }<br><br>  return $result;<br>}<br><br>$randomDomain = sprintf(<br>  &quot;%s.example.com&quot;,<br>  getBytesFromString(<br>    &#39;abcdefghijklmnopqrstuvwxyz0123456789&#39;,<br>    16,<br>  ),<br>);<br><br>echo $randomDomain;</pre><p><strong>New</strong></p><pre>// A \Random\Engine may be passed for seeding,<br>// the default is the secure engine.<br>$randomizer = new \Random\Randomizer();<br>$randomDomain = sprintf(<br>  &quot;%s.example.com&quot;,<br>  $randomizer-&gt;getBytesFromString(<br>    &#39;abcdefghijklmnopqrstuvwxyz0123456789&#39;,<br>    16,<br>  ),<br>);<br>echo $randomDomain;</pre><h3><strong>6. New Randomizer::getFloat() and Randomizer::nextFloat() methods</strong></h3><p><strong>Old</strong></p><pre>// Returns a random float between $min and $max, both including.<br>function getFloat(float $min, float $max) {<br>  // This algorithm is biased for specific inputs and may<br>  // return values outside the given range. This is impossible<br>  // to work around in userland.<br>  $offset = random_int(0, PHP_INT_MAX) / PHP_INT_MAX;<br>  return $offset * ($max - $min) + $min;<br>}<br><br>$temperature = getFloat(-89.2, 56.7);<br>$chanceForTrue = 0.1;<br>// getFloat(0, 1) might return the upper bound, i.e. 1,<br>// introducing a small bias.<br>$myBoolean = getFloat(0, 1) &lt; $chanceForTrue;</pre><p><strong>New</strong></p><pre>$randomizer = new \Random\Randomizer();<br>$temperature = $randomizer-&gt;getFloat(<br>  -89.2,<br>  56.7,<br>  \Random\IntervalBoundary::ClosedClosed,<br>);<br><br>$chanceForTrue = 0.1;<br>// Randomizer::nextFloat() is equivalent to<br>// Randomizer::getFloat(0, 1, \Random\IntervalBoundary::ClosedOpen).<br>// The upper bound, i.e. 1, will not be returned.<br>$myBoolean = $randomizer-&gt;nextFloat() &lt; $chanceForTrue;</pre><h3><strong>New Classes, Interfaces, and Functions</strong></h3><ul><li>New <a href="https://www.php.net/manual/en/domelement.getattributenames.php">DOMElement::getAttributeNames()</a>, <a href="https://www.php.net/manual/en/domelement.insertadjacentelement.php">DOMElement::insertAdjacentElement()</a>, <a href="https://www.php.net/manual/en/domelement.insertadjacenttext.php">DOMElement::insertAdjacentText()</a>, <a href="https://www.php.net/manual/en/domelement.toggleattribute.php">DOMElement::toggleAttribute()</a>, <a href="https://www.php.net/manual/en/domnode.contains.php">DOMNode::contains()</a>, <a href="https://www.php.net/manual/en/domnode.getrootnode.php">DOMNode::getRootNode()</a>, <a href="https://www.php.net/manual/en/domnode.isequalnode.php">DOMNode::isEqualNode()</a>, DOMNameSpaceNode::contains(), and <a href="https://www.php.net/manual/en/domparentnode.replacechildren.php">DOMParentNode::replaceChildren()</a> methods.</li><li>New <a href="https://www.php.net/manual/en/intlcalendar.setdate.php">IntlCalendar::setDate()</a>, <a href="https://www.php.net/manual/en/intlcalendar.setdatetime.php">IntlCalendar::setDateTime()</a>, <a href="https://www.php.net/manual/en/intlgregoriancalendar.createfromdate.php">IntlGregorianCalendar::createFromDate()</a>, and <a href="https://www.php.net/manual/en/intlgregoriancalendar.createfromdatetime.php">IntlGregorianCalendar::createFromDateTime()</a> methods.</li><li>New ldap_connect_wallet(), and ldap_exop_sync() functions.</li><li>New <a href="https://www.php.net/manual/en/function.mb-str-pad.php">mb_str_pad()</a> function.</li><li>New <a href="https://www.php.net/manual/en/function.posix-sysconf.php">posix_sysconf()</a>, <a href="https://www.php.net/manual/en/function.posix-pathconf.php">posix_pathconf()</a>, <a href="https://www.php.net/manual/en/function.posix-fpathconf.php">posix_fpathconf()</a>, and <a href="https://www.php.net/manual/en/function.posix-eaccess.php">posix_eaccess()</a> functions.</li><li>New <a href="https://www.php.net/manual/en/reflectionmethod.createfrommethodname.php">ReflectionMethod::createFromMethodName()</a> method.</li><li>New <a href="https://www.php.net/manual/en/function.socket-atmark.php">socket_atmark()</a> function.</li><li>New <a href="https://www.php.net/manual/en/function.str-increment.php">str_increment()</a>, <a href="https://www.php.net/manual/en/function.str-decrement.php">str_decrement()</a>, and <a href="https://www.php.net/manual/en/function.stream-context-set-options.php">stream_context_set_options()</a> functions.</li><li>New <a href="https://www.php.net/manual/en/ziparchive.getarchiveflag.php">ZipArchive::getArchiveFlag()</a> method.</li><li>Support for generation EC keys with custom EC parameters in OpenSSL extension.</li><li>New INI setting <a href="https://www.php.net/manual/en/migration83.other-changes.php#migration83.other-changes.ini">zend.max_allowed_stack_size</a> to set the maximum allowed stack size.</li></ul><h3><strong>Deprecations and backward compatibility breaks</strong></h3><ul><li>More Appropriate Date/Time Exceptions.</li><li>Assigning a negative index n to an empty array will now make sure that the next index is n + 1 instead of 0.</li><li>Changes to the <em>range()</em> function.</li><li>Changes in re-declaration of static properties in traits.</li><li>The <em>U_MULTIPLE_DECIMAL_SEPERATORS</em> constant is deprecated in favor of <em>U_MULTIPLE_DECIMAL_SEPARATORS</em>.</li><li>The <a href="https://www.php.net/manual/en/random.constants.php#constant.mt-rand-php"><em>MT_RAND_PHP</em></a><em> Mt19937</em> variant is deprecated.</li><li><a href="https://www.php.net/manual/en/reflectionclass.getstaticproperties.php"><em>ReflectionClass::getStaticProperties()</em></a> is no longer nullable.</li><li>INI settings <a href="https://www.php.net/manual/en/info.configuration.php#ini.assert.active">assert.active</a>, <a href="https://www.php.net/manual/en/info.configuration.php#ini.assert.bail">assert.bail</a>, <a href="https://www.php.net/manual/en/info.configuration.php#ini.assert.callback">assert.callback</a>, <a href="https://www.php.net/manual/en/info.configuration.php#ini.assert.exception">assert.exception</a>, and <a href="https://www.php.net/manual/en/info.configuration.php#ini.assert.warning">assert.warning</a> have been deprecated.</li><li>Calling <a href="https://www.php.net/manual/en/function.get-class.php"><em>get_class()</em></a> and <a href="https://www.php.net/manual/en/function.get-parent-class.php"><em>get_parent_class()</em></a> without arguments are deprecated.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5130aa235a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Text Manipulation: A Comprehensive Guide to Various Techniques for Replacing Text in Strings]]></title>
            <link>https://rabiul-islam.medium.com/text-manipulation-a-comprehensive-guide-to-various-techniques-for-replacing-text-in-strings-9ff585dbf7e2?source=rss-4ff0995c8d8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ff585dbf7e2</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[text-manipulation]]></category>
            <dc:creator><![CDATA[Rabiul Islam]]></dc:creator>
            <pubDate>Sun, 12 Nov 2023 14:08:35 GMT</pubDate>
            <atom:updated>2023-11-12T14:08:35.472Z</atom:updated>
            <content:encoded><![CDATA[<p>In the realm of software development, it’s common for developers to encounter situations demanding the alteration or substitution of text components. This need for text manipulation arises frequently in diverse scenarios. Exploring this topic in depth, today’s conversation will delve into the intricacies of replacing strings. We’ll traverse through multiple dimensions, from SQL queries, where the database is directly engaged for text modifications, to the dynamic server-side realm of PHP code, adept at handling textual transformations. Furthermore, our exploration extends to the client-side king JavaScript, unraveling how it proficiently manages string replacement tasks within web applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SYceePwJny0npT0_" /><figcaption>Photo by <a href="https://unsplash.com/@clemhlrdt?utm_source=medium&amp;utm_medium=referral">Clément Hélardot</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>1. SQL Query</strong></h3><p>If you want to replace text by SQL query then it will be the best technique. It is faster than using other techniques. Suppose, you have a users table like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*Nlbd08kaxpJkF2vPJ0kxgw.png" /><figcaption>users table</figcaption></figure><p>Now, you want to replace ‘+88’ to ‘+1’ then you can write a SQL query like below,</p><pre>UPDATE users <br>SET phone = CONCAT(&#39;+1&#39;, SUBSTRING(phone, INSTR(phone, &#39;+88&#39;) + 3)) <br>WHERE phone LIKE &#39;+88%&#39;;</pre><p><strong>Explanation:</strong></p><ol><li><em>UPDATE users</em>: This command perform UPDATE operation in the users table.</li><li><em>SET phone = CONCAT(‘+1’, SUBSTRING(phone, INSTR(phone, ‘+88’) + 3))</em></li></ol><blockquote><em>2.1. SUBSTRING(phone, INSTR(phone, ‘+88’’) + 3):</em> This extracts a substring of the “phone” column starting from the character just after ‘+88’. It effectively removes the ‘+88’ prefix from the phone number.</blockquote><blockquote><em>2.2. +1</em>: This will add a prefix of that number.</blockquote><blockquote><em>2.3. INSTR(phone, ‘+88’’)</em>: The function INSTR means ‘In String’. This function returns the first occurrence(position in integer no) of the specified substring.</blockquote><blockquote>Format: <em>INSTR(‘source_string’,’search_string’)</em></blockquote><blockquote>2.4. Concat +1 with the extract number.</blockquote><p>3.<em> WHERE phone LIKE ‘+88%’</em>: Find users where the phone contains +88 at the beginning.</p><h3><strong>2. PHP Function:</strong></h3><p>You can replace text from a string and array.</p><h4><strong>a. Replace single text from string:</strong></h4><p>Let’s say,</p><pre>$text = &quot;Hello, developers!&quot;;<br>$replace = &quot;PHP&quot;;<br>$newString = str_replace(&quot;developers&quot;, $replace, $text);<br>echo $newString;</pre><p><strong>Explanation:</strong></p><p>The <em>str_replace</em> function searches for all occurrences of the specified text in the original string and replaces them with the replacement text. The result is stored in the variable <em>$newString</em>, which is then echoed to the screen.</p><p>The output will be: “<em>Hello, PHP!</em>”</p><h4>b. Replace multiple text from string:</h4><p>Let’s say,</p><pre>$string = &quot;Hello, developers. Let&#39;s start a new thing today!&quot;;<br>$search = [&#39;start&#39;,&#39;today&#39;];<br>$replacement = [&#39;explore&#39;,&#39;now&#39;];<br>$newString = str_replace($search, $replacement, $string);<br>echo $newString;</pre><p>The output will be: “<em>Hello, developers. Let’s explore a new thing now!</em>”</p><h3>3. Javascript Function:</h3><h4>a. Replace single text using replace function:</h4><pre>let text = &quot;Hello, developers!&quot;;<br>let replace = &quot;JavaScript&quot;;<br>let replacedString = text.replace(&quot;developers&quot;, replace);<br>console.log(newString);</pre><p><strong>Explanation :</strong></p><p>First define the original text in the variable <em>text</em>. Then, we specify the text we want to replace (in this case, “<em>JavaScript</em>”) and the text we want to replace it with (in this case, “<em>JavaScript</em>”). The replace method searches for the first occurrence of the specified text in the original string and replaces it with the replacement text. The result is stored in the replacedString variable, and we log it to the console.</p><p>The output will be: “<em>Hello, JavaScript!</em>”</p><h4><strong>b. Replace text using regular expression:</strong></h4><pre>let myText = &quot;Lorem Ipsum is simply dummy text of the development industry.&quot;;<br><br>let replacement_texts = {<br>&quot;simply&quot;: &quot;a common&quot;,<br>&quot;text&quot;: &quot;paragraph&quot;,<br>&quot;industry&quot;: &quot;section&quot;<br>};<br><br>for (let key in replacement_texts) {<br>  myText = myText.replace(new RegExp(key, &#39;g&#39;), replacement_texts[key]);<br>}<br><br>console.log(myText);</pre><p><strong>Explanation:</strong></p><p>First declare an object replacement_texts with the text to replace and the replacement text. We loop through the object and use regular expressions with the ‘g’ flag to replace all occurrences of the specified text in the original string.</p><p>The output will be: “<em>Lorem Ipsum is a common dummy paragraph of the development section.</em>”</p><p>Please share your feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ff585dbf7e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>