imagefontheight() PHP में एक अंतर्निहित फ़ंक्शन है जिसका उपयोग निर्दिष्ट फ़ॉन्ट में किसी वर्ण की पिक्सेल ऊंचाई प्राप्त करने के लिए किया जाता है।
सिंटैक्स
int imagefontheight(int $font)
पैरामीटर्स
imagefontheight() एक पैरामीटर $font लेता है। यह फ़ॉन्ट मान रखता है। $font मान अंतर्निहित फ़ॉन्ट्स के लिए 1, 2, 3, 4, और 5 हो सकते हैं या कस्टम फ़ॉन्ट्स के लिए imageloadfont() फ़ंक्शन का उपयोग करके भी निर्दिष्ट किए जा सकते हैं।
रिटर्न मान
imagefontheight() फ़ॉन्ट की पिक्सेल ऊंचाई लौटाता है।
उदाहरण 1
<?php
// फ़ॉन्ट ऊंचाई मान 1 से 5 तक बदले जा सकते हैं
echo 'Font height: ' . imagefontheight(3);
?>
आउटपुट
Font height: 13
उदाहरण 2
<?php
// 1 से 5 तक फ़ॉन्ट ऊंचाई प्राप्त करें
echo 'Font height for the font value 1 is ' . imagefontheight(1) . '<br>'; // <br> लाइन ब्रेक के लिए उपयोग किया जाता है
echo 'Font height for the font value 2 is ' . imagefontheight(2) . '<br>';
echo 'Font height for the font value 3 is ' . imagefontheight(3) . '<br>';
echo 'Font height for the font value 4 is ' . imagefontheight(4) . '<br>';
echo 'Font height for the font value 5 is ' . imagefontheight(5) . '<br>';
?>
आउटपुट
Font height for the font value 1 is 8 Font height for the font value 2 is 13 Font height for the font value 3 is 13 Font height for the font value 4 is 16 Font height for the font value 5 is 15