PHP Switching Tabs And Spaces – String Function

<?php$tabbed = str_replace(' ',"\t",'this is a test');
$spaced = str_replace("\t",' ','this is a test');print "With Tabs: <pre>$tabbed

“;
print “With Spaces:

$spaced

“;
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.