<?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>sed &#8211; VeriTeknik</title>
	<atom:link href="https://www.veriteknik.net.tr/en/tag/sed/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.veriteknik.net.tr/en/</link>
	<description>VeriTeknik Bilişim &#124; VeriTeknik Bilişim</description>
	<lastBuildDate>Tue, 19 Jun 2012 11:53:19 +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>PHP : Convert/Replace Short Open Tags</title>
		<link>https://www.veriteknik.net.tr/en/php-convert-open-tags/</link>
					<comments>https://www.veriteknik.net.tr/en/php-convert-open-tags/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Tue, 19 Jun 2012 11:53:19 +0000</pubDate>
				<category><![CDATA[httpd]]></category>
		<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[Programmin]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[tag]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=557</guid>

					<description><![CDATA[<p>Using short open tags, such as &#60;? on your PHP code is not so clever. Other than the debate going on whether short open tags won&#8217;t be available on PHP6 or not, it is possible that your shared hosting has disabled it for some reason, or you might have to migrate your code sometime somewhere [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/php-convert-open-tags/">PHP : Convert/Replace Short Open Tags</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Using short open tags, such as <strong>&lt;?</strong> on your PHP code is not so clever. Other than the debate going on whether short open tags won&#8217;t be available on PHP6 or not, it is possible that your shared hosting has disabled it for some reason, or you might have to migrate your code sometime somewhere it is not supported any longer. For the sake of clean coding, always use clean tags. Other than obeying the standards for technical reasons, it is also essential for developing clean, easy-to-read codes for yourself, other people reading your code or even the IDE/Framework you&#8217;re using!</p>
<p>If somehow, this article is the first place you&#8217;ve realized you should stop using short open tags, it&#8217;s never too late! Below is a find / sed line to convert your php files from short open tags to &#8220;normal&#8221; ones. This line works pretty good but it&#8217;s always a good idea to backup your scripts before doing such massive automated injection.</p>
<pre class="brush: bash; gutter: true; first-line: 1">find . -iname '*.php' -type f -print0 |xargs -0 sed -i -e 's/&lt;? /&lt;?php /g' -e 's/&lt;?\/\//&lt;?php \/\//g' -e 's/&lt;?\/\*/&lt;?php \/\*/g' -e 's/&lt;?\=/&lt;?php echo/g'</pre>
<p>Don&#8217;t forget that this line will look for <strong>*.php</strong> files under the <strong>current</strong> folder due to the <strong>dot</strong> (<strong>.</strong>) which is the first argument of the <strong>find</strong> command.<br />
It will apply these replaces:</p>
<table>
<tbody>
<tr>
<td><strong>From</strong></td>
<td><strong>To</strong></td>
</tr>
<tr>
<td>&lt;?</td>
<td>&lt;?php</td>
</tr>
<tr>
<td>&lt;?//</td>
<td>&lt;?php //</td>
</tr>
<tr>
<td>&lt;?/*</td>
<td>&lt;?php /*</td>
</tr>
<tr>
<td>&lt;?=</td>
<td>&lt;?php echo</td>
</tr>
</tbody>
</table>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/php-convert-open-tags/">PHP : Convert/Replace Short Open Tags</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/php-convert-open-tags/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">557</post-id>	</item>
	</channel>
</rss>
