<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Demos &#8211; Extreme Web Designs</title>
	<atom:link href="https://theextremewebdesigns.com/blog/category/demos/feed/" rel="self" type="application/rss+xml" />
	<link>https://theextremewebdesigns.com/blog</link>
	<description>Web Design and Web Development</description>
	<lastBuildDate>Mon, 14 Jul 2014 10:14:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>
<site xmlns="com-wordpress:feed-additions:1">156673191</site>	<item>
		<title>Remove Single Or Multiple Attributes Using jQuery Examples</title>
		<link>https://theextremewebdesigns.com/blog/remove-single-or-multiple-attributes-using-jquery-examples/</link>
					<comments>https://theextremewebdesigns.com/blog/remove-single-or-multiple-attributes-using-jquery-examples/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 14 Jul 2014 10:14:31 +0000</pubDate>
				<category><![CDATA[Demos]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Demos]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[jquery-demos]]></category>
		<category><![CDATA[jquery-snippets]]></category>
		<category><![CDATA[jquery-tips]]></category>
		<guid isPermaLink="false">https://theextremewebdesigns.com/blog/?p=3991</guid>

					<description><![CDATA[When working with different elements of a website, there might be times when you have come across different elements containing a single attribute or multiple attributes. These attributes can, in turn, consist of single or multiple properties. So in this article, I am going to share with you very easy way to get rid of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>When working with different elements of a website, there might be times when you have come across different elements containing a single attribute or multiple attributes. These attributes can, in turn, consist of single or multiple properties. So in this article, I am going to share with you very easy way to get rid of either a single attribute or multiple attributes from any element of your choice using jQuery with easy to follow examples.</p>
<h2>How To Remove Single Or Multiple Attributes:</h2>
<p><div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=4021" method="post" name="form1" target="_blank" id="form1">


	<input type="hidden" name="shortcode_content" id="shortcode_content" value="" />

        <div class="try_demo_btn_container">


            <button type="submit" name="sbt_make_demo" id="sbt_make_demo" class="btn-primary btn-try-demo">
                Try Demo
            </button>


        </div><!-- .try_demo_btn_container -->

    </form>
    </div>
     Let’s look at how to do this by means of examples. Assume that we have couple of div elements with attributes. We will see how to remove single &amp; multiple attributes from it.</p>
<h2>Examples:</h2>
<h3>Example 1: Remove single attribute from an element:</h3>
<p>In this example, we have a div with an attribute called “style”. This “style” attribute contains multiple properties such as “background-color” and “color”. We also have a button and when this button is clicked, we will remove the style attribute and the div will appear plain.</p>
<pre class="lang:xhtml decode:true">&lt;div id="my_div1" style="background-color: gold; color: darkgreen;"&gt;This is a div with a single "style" attribute.&lt;/div&gt;

&lt;input type="submit" name="sbt_remove_single_property" id="sbt_remove_single_property" value="Remove Style Attribute"&gt;

&lt;script type="text/javascript" language="javascript"&gt;

   $(document).ready(function () {

       $('#sbt_remove_single_property').on("click", function () {

           $('#my_div1').removeAttr('style');

       });

   });

&lt;/script&gt;</pre>
<h3>Example 2: Remove multiple attributes from an element:</h3>
<p>In this example, we have a div with an attribute called “style” and “class”. This “style” attribute contains multiple properties such as “background-color” and “color”. The “class” attribute contains multiple properties that affects the way this div is displayed even further. Next, we have a button and when this button is clicked, we will remove both the “style” and the “class” attributes and the div will appear plain.</p>
<pre class="lang:xhtml decode:true ">&lt;div id="my_div2" class="highlight" style="background-color: lightblue; color: purple;"&gt;This is a div with multiple attributes (style and class).&lt;/div&gt;

&lt;input type="submit" name="sbt_remove_multiple_properties" id="sbt_remove_multiple_properties" value="Remove Style and Class Attributes"&gt;

&lt;script type="text/javascript" language="javascript"&gt;

   $(document).ready(function () {

       $('#sbt_remove_multiple_properties').on("click", function () {

           $('#my_div2').removeAttr('style class');

       });

   });

&lt;/script&gt;</pre>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=4021" method="post" name="form1" target="_blank" id="form1">


	<input type="hidden" name="shortcode_content" id="shortcode_content" value="" />

        <div class="try_demo_btn_container">


            <button type="submit" name="sbt_make_demo" id="sbt_make_demo" class="btn-primary btn-try-demo">
                Try Demo
            </button>


        </div><!-- .try_demo_btn_container -->

    </form>
    </div>
    
<h3>Conclusion:</h3>
<p>So from the above example, we can conclude that we can remove a single attribute or multiple attributes from any element. <strong>To remove multiple attributes, simply specifying the attributes separated by space will suffice</strong>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://theextremewebdesigns.com/blog/remove-single-or-multiple-attributes-using-jquery-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4021</post-id>	</item>
		<item>
		<title>PHP Replace Array Value Example</title>
		<link>https://theextremewebdesigns.com/blog/php-replace-array-value-how-to-replace-array-value-using-php-example/</link>
					<comments>https://theextremewebdesigns.com/blog/php-replace-array-value-how-to-replace-array-value-using-php-example/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 08 Feb 2013 22:03:20 +0000</pubDate>
				<category><![CDATA[Demos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Demos]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[demos-php]]></category>
		<category><![CDATA[php-tips]]></category>
		<guid isPermaLink="false">https://theextremewebdesigns.com/blog/?p=2270</guid>

					<description><![CDATA[One of the coolest things of array is that you can hold as much data as you need. So when dealing with arrays, there might have been a time when one would come across a requirement to replace or change array value with another value. In this article, I am going to show you how [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One of the coolest things of <a title="PHP Add To An Array | Add Element To Array Using PHP Examples" href="https://theextremewebdesigns.com/blog/php-add-to-an-array-add-element-to-array-using-php-examples/" target="_blank">array</a> is that you can hold as much data as you need. So when dealing with arrays, there might have been a time when one would come across a requirement to <strong>replace or change array value with another value</strong>. In this article, I am going to show you <em><strong>how to use PHP to replace array valu</strong></em> by means of simple examples. Demos follow.<span id="more-2270"></span></p>
<h2>How To use PHP to Replace Array Value</h2>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=2270" method="post" name="form1" target="_blank" id="form1">


	<input type="hidden" name="shortcode_content" id="shortcode_content" value="" />

        <div class="try_demo_btn_container">


            <button type="submit" name="sbt_make_demo" id="sbt_make_demo" class="btn-primary btn-try-demo">
                Try Demo
            </button>


        </div><!-- .try_demo_btn_container -->

    </form>
    </div>
    
<p>Let&#8217;s consider a simple example. Let&#8217;s assume that we have an array that consists of fruit names. We will now choose a fruit name (value) and we will replace this value in this array with another value i.e. with another fruit name. In this scenario, there arises 2 cases.</p>
<p>1. Replacing the array value assuming that all values in the array are unique.</p>
<p>2. Replacing the array value assuming that some or all values in the array may be duplicate values of an original value.</p>
<p>So let&#8217;s start with the first case.</p>
<h3>Example 1: Replacing the Array Value Using PHP assuming that all values in the array are unique</h3>
<pre class="lang:php decode:true" title="Example 1">echo 'Example 1 - Replace value "apple" with value "strawberry"&lt;br /&gt;';

//Declare an array
$my_fruits_array = array('apple', 'mango', 'grapes', 'pineapple', 'apple', 'guava', 'apple');

//Print the contents of the array.
echo 'Following are the original array contents:&lt;br /&gt;';
echo '&lt;pre&gt;';
print_r($my_fruits_array);
echo '&lt;/pre&gt;';

//Replace the value "apple" with "strawberry" in the array
$search_for = "apple";
$replace_with = "strawberry";
for($i=0;$i&lt;count($my_fruits_array);$i++) 
{
	if($my_fruits_array[$i] == $search_for) 
	{
		$my_fruits_array[$i] = $replace_with;
	}
}

//Print the contents of the array.
echo 'Following are the array contents AFTER removing the duplicate values from array:&lt;br /&gt;';
echo '&lt;pre&gt;';
print_r($my_fruits_array);
echo '&lt;/pre&gt;';</pre>
<h3>Example 2: Replacing the Array Value Using PHP assuming that all mutiple values in the array need replacement</h3>
<pre class="lang:php decode:true crayon-selected" title="Example 2: Replace Array Value Using PHP assuming that all mutiple values in the array need replacement">echo 'Example 2: Replace the value "apple" with value "strawberry" and "mango" value with "fig" value in array &lt;br /&gt;';

//Declare an array
$my_fruits_array = array('apple', 'mango', 'grapes', 'pineapple', 'apple', 'guava', 'apple', 'mango');

//Print the contents of the array.
echo 'Following are the original array contents:&lt;br /&gt;';
echo '&lt;pre&gt;';
print_r($my_fruits_array);
echo '&lt;/pre&gt;';

//Replace the value "apple" with "strawberry" value and "mango" value with "fig" value in array
$replacements_array = array( 'apple' =&gt; 'strawberry', 'mango' =&gt; 'fig');

//For each of the replacement values in the array, loop through the array values
foreach ( $replacements_array as $key1 =&gt; $val1 )
{
	//Loop through each of the original $my_fruits_array so that we can check if the value matches with our replacement array key.If yes, we will replace the value of $my_fruits_array with the corresponding replacement value from $replacements_array array.
	foreach ( $my_fruits_array as $key2 =&gt; $val2 )
	{	
		//If the value to be reaplaced in replacements_array == already existing value in $my_fruits_array
		if( $key1 == $val2 )
		{
			//Then simply use the index of $my_fruits_array[ to update its value with the replacement value from $replacements_array
			$my_fruits_array[$key2] = $val1;
		}
	}
}

//Print the contents of the array.
echo 'Following are the array contents AFTER removing the duplicate values from array:&lt;br /&gt;';
echo '&lt;pre&gt;';
print_r($my_fruits_array);
echo '&lt;/pre&gt;';</pre>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=2270" method="post" name="form1" target="_blank" id="form1">


	<input type="hidden" name="shortcode_content" id="shortcode_content" value="" />

        <div class="try_demo_btn_container">


            <button type="submit" name="sbt_make_demo" id="sbt_make_demo" class="btn-primary btn-try-demo">
                Try Demo
            </button>


        </div><!-- .try_demo_btn_container -->

    </form>
    </div>
    
<h5>That&#8217;s it!</h5>
<p>Do you know of any other ways to use  <em><strong>PHP to replace array values</strong></em>? Feel free to suggest by commenting below.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://theextremewebdesigns.com/blog/php-replace-array-value-how-to-replace-array-value-using-php-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2270</post-id>	</item>
	</channel>
</rss>
