<?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>single quoted Archives - Artificial Intelligence</title>
	<atom:link href="https://www.aiuniverse.xyz/tag/single-quoted/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.aiuniverse.xyz/tag/single-quoted/</link>
	<description>Exploring the universe of Intelligence</description>
	<lastBuildDate>Tue, 02 May 2023 11:17:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>What is String in PHP ?</title>
		<link>https://www.aiuniverse.xyz/what-is-string-in-php/</link>
					<comments>https://www.aiuniverse.xyz/what-is-string-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Maruti Kr.]]></dc:creator>
		<pubDate>Tue, 02 May 2023 11:17:44 +0000</pubDate>
				<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[Double Quoted]]></category>
		<category><![CDATA[php string]]></category>
		<category><![CDATA[single quoted]]></category>
		<category><![CDATA[Sring in php]]></category>
		<category><![CDATA[What is String in PHP]]></category>
		<guid isPermaLink="false">https://www.aiuniverse.xyz/?p=16649</guid>

					<description><![CDATA[<p>In PHP, A string is a sequence of characters, such as letters, numbers, and symbols, that is used to represent text. Strings in PHP are enclosed in <a class="read-more-link" href="https://www.aiuniverse.xyz/what-is-string-in-php/">Read More</a></p>
<p>The post <a href="https://www.aiuniverse.xyz/what-is-string-in-php/">What is String in PHP ?</a> appeared first on <a href="https://www.aiuniverse.xyz">Artificial Intelligence</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-media-text alignwide is-stacked-on-mobile"><figure class="wp-block-media-text__media"><img fetchpriority="high" decoding="async" width="681" height="365" src="https://www.aiuniverse.xyz/wp-content/uploads/2023/05/string-2.jpg" alt="" class="wp-image-16650 size-full" srcset="https://www.aiuniverse.xyz/wp-content/uploads/2023/05/string-2.jpg 681w, https://www.aiuniverse.xyz/wp-content/uploads/2023/05/string-2-300x161.jpg 300w" sizes="(max-width: 681px) 100vw, 681px" /></figure><div class="wp-block-media-text__content">
<p>In PHP, A string is a sequence of characters, such as letters, numbers, and symbols, that is used to represent text. Strings in PHP are enclosed in quotes, either single quotes (&#8216;) or double quotes (&#8220;).</p>



<p>There are two ways to specify a string literal in PHP.</p>
</div></div>



<ol class="wp-block-list">
<li>single quoted</li>



<li>double quoted</li>
</ol>



<h2 class="wp-block-heading">Single quotes:</h2>



<p>In PHP, single quoted strings are one way to represent a string literal. Single quoted strings are denoted by enclosing the string within single quotes (&#8216;).</p>



<p><strong>For Example</strong>:</p>



<pre class="wp-block-code"><code>&lt;?php  
       $str='Hello I'm single quote Example'; 
       echo $str;  
?>  </code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code>Hello I'm single quote Example</code></pre>



<p>We can store multiple line text, special characters, and escape sequences in a single-quoted PHP string.</p>



<p><strong>Example 2</strong></p>



<pre class="wp-block-code"><code>&lt;?php  
$str1='Hello text   
multiple line  
text within single quoted string';  
$str2='Using double "quote" directly inside single quoted string';  
$str3='Using escape sequences \n in single quoted string';  
echo "$str1 &lt;br/> $str2 &lt;br/> $str3";  
?>  </code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code>Hello text multiple line text within single quoted string 
Using double "quote" directly inside single quoted string 
Using escape sequences \n in single quoted string</code></pre>



<p><strong>Example3:</strong></p>



<pre class="wp-block-code"><code>&lt;?php  
$num1=10;   
$str1='trying variable $num1';  
$str2='trying backslash n and backslash t inside single quoted string \n \t';  
$str3='Using single quote \'my quote\' and \\backslash';  
echo "$str1 &lt;br/> $str2 &lt;br/> $str3";  
?>  </code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code>trying variable $num1 
trying backslash n and backslash t inside single quoted string \n \t 
Using single quote 'my quote' and \backslash</code></pre>



<h2 class="wp-block-heading">Double Quoted:</h2>



<p>In PHP, double quoted strings are one way to represent a string literal. Double quoted strings are denoted by enclosing the string within double quotes (&#8220;).</p>



<p><strong>For Example</strong>:</p>



<pre class="wp-block-code"><code>&lt;?php  
$str="Hello I'm double quote Example";  
echo $str;  
?>  </code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code>Hello I'm double quote Example</code></pre>



<p>Now, you can&#8217;t use double quote directly inside double quoted string.</p>



<p><strong>Example 2</strong></p>



<pre class="wp-block-code"><code>&lt;?php  
$str1="Using double "quote" directly inside double quoted string";  
echo $str1;  
?>  </code></pre>



<p><strong>Output:</strong> </p>



<pre class="wp-block-code"><code>Parse error: syntax error, unexpected 'quote' (T_STRING) in C:\wamp\www\string1.php on line 2</code></pre>



<p>We can store multiple line text, special characters and escape sequences in a double quoted PHP string.</p>



<p><strong>Example 3</strong></p>



<pre class="wp-block-code"><code>&lt;?php  
$str1="Hello text   
multiple line  
text within double quoted string";  
$str2="Using double \"quote\" with backslash inside double quoted string";  
$str3="Using escape sequences \n in double quoted string";  
echo "$str1 &lt;br/> $str2 &lt;br/> $str3";  
?>  </code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code>Hello text multiple line text within double quoted string 
Using double "quote" with backslash inside double quoted string 
Using escape sequences in double quoted string</code></pre>



<p>In double quoted strings, variable will be interpreted.</p>



<p><strong>Example 4</strong></p>



<pre class="wp-block-code"><code>&lt;?php  
$num1=10;   
echo "Number is: $num1";  
?>  </code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code>Number is: 10</code></pre>
<p>The post <a href="https://www.aiuniverse.xyz/what-is-string-in-php/">What is String in PHP ?</a> appeared first on <a href="https://www.aiuniverse.xyz">Artificial Intelligence</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.aiuniverse.xyz/what-is-string-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
