PHP show_source() ফাংশন

বিবরণ ও ব্যবহার

show_source() ফাংশনকে ফাইলকে সার্ভিসকোড হাইলাইট করে

এই ফাংশন highlight_file() এই ফাংশন PHP ফাইলকে সার্ভিসকোড হাইলাইট করে

show_source()

গঠন ও ব্যবহারfilenameshow_source(return,
) পারামিটার
filename বিবরণ
return বাধ্যতামূলক। হাইলাইট করা হওয়া PHP ফাইলের পাথ

বিবরণ

এই ফাংশন PHP সার্ভিসকোড হাইলাইট প্রোগ্রামের রঙ ব্যবহার করে, filename এর কোডের সার্ভিসকোড হাইলাইট করা হয়

অনেক সার্ভার এমনভাবে কনফিগার করা হয়েছে যে phps সম্প্রসারণভুক্ত ফাইলগুলিকে স্বচালিতভাবে হাইলাইট করা হয়। উদাহরণস্বরূপ, example.phps ফাইল দেখার সময়, সেই ফাইলটির সার্ভিসকোড হাইলাইট করা হয়েছে। এই ফিচারটি সক্রিয় করতে, নিচের এই লাইনটি যোগ করুন httpd.conf

AddType application/x-httpd-php-source .phps

Return Value

If return If the parameter is set to true, then the function will return the highlighted code instead of outputting it. Otherwise, if successful, it returns true, and if failed, it returns false.

Tips and Comments

Warning:It should be noted that when using the show_source() function, do not inadvertently disclose sensitive information such as passwords or other types of sensitive information, otherwise potential security risks may arise.

Example

"test.php":

<html>
<body>
<?php
show_source("test.php");
?>
</body>
</html>

Output:

<html> 
<body> 
<?php 
show_source("test.php");
?>
</body> 
</html>

The result in the browser is similar to this:

<html>
<body>
<code>
<span style="color: #000000"><html></span>
<br />
<body>
<br />
<span style="color: #0000BB"><?php</span>
<br />show_source</span>
<span style="color: #007700">(</span>
<span style="color: #DD0000">"test.php"</span>
<span style="color: #007700">);<br /></span>
<span style="color: #0000BB">?><br /></span>
</body>
<br />
</html></span>
</code>
</body>
</html>