دروس PHP

PHP الرئيسية مقدمة PHP تثبيت PHP بناء جملة PHP تعليقات PHP متغيرات PHP PHP صدى / طباعة أنواع بيانات PHP سلاسل PHP أرقام PHP PHP الرياضيات ثوابت PHP مشغلي PHP PHP إذا ... آخر ... Elseif مفتاح PHP حلقات PHP وظائف PHP مصفوفات PHP PHP Superglobals PHP RegEx

نماذج PHP

معالجة نموذج PHP التحقق من صحة نموذج PHP نموذج PHP مطلوب نموذج PHP URL / البريد الإلكتروني اكتمل نموذج PHP

PHP متقدم

تاريخ ووقت PHP تضمين PHP معالجة ملفات PHP فتح / قراءة ملف PHP إنشاء / كتابة ملف PHP تحميل ملف PHP ملفات تعريف الارتباط PHP جلسات PHP مرشحات PHP مرشحات PHP متقدم وظائف رد الاتصال PHP PHP JSON استثناءات PHP

PHP OOP

PHP ما هو OOP فئات / كائنات PHP منشئ PHP مدمر PHP معدِّلات الوصول إلى PHP الوراثة PHP ثوابت PHP فئات مجردة PHP واجهات PHP سمات PHP طرق PHP الثابتة خصائص PHP الثابتة مساحات أسماء PHP PHP تكرارات

قاعدة بيانات MySQL

قاعدة بيانات MySQL اتصال MySQL إنشاء قاعدة بيانات MySQL إنشاء جدول MySQL MySQL إدراج البيانات MySQL الحصول على آخر معرف إدراج عدة MySQL تم تجهيز MySQL MySQL حدد البيانات MySQL أين ترتيب MySQL حسب MySQL حذف البيانات تحديث بيانات MySQL بيانات MySQL المحدودة

لغة PHP XML

موزعي PHP XML محلل PHP SimpleXML PHP SimpleXML - احصل على PHP XML Expat PHP XML DOM

PHP - أجاكس

مقدمة أجاكس أجاكس بي إتش بي قاعدة بيانات أجاكس AJAX XML بحث أجاكس لايف استطلاع أجاكس

أمثلة PHP

أمثلة PHP مترجم PHP اختبار PHP تمارين PHP شهادة PHP

مرجع PHP

نظرة عامة على PHP صفيف PHP تقويم PHP تاريخ PHP دليل PHP خطأ PHP استثناء PHP نظام ملفات PHP مرشح PHP PHP FTP PHP JSON كلمات PHP PHP Libxml PHP Mail PHP الرياضيات متفرقات PHP PHP MySQLi شبكة PHP التحكم في إخراج PHP PHP RegEx PHP SimpleXML PHP ستريم سلسلة PHP معالجة متغيرة PHP محلل PHP XML PHP Zip المناطق الزمنية PHP

وظائف التحكم في إخراج PHP


وظائف التحكم في إخراج PHP

يوفر PHP مجموعة من الوظائف التي تتحكم في المحتوى الذي يتم إرساله إلى المتصفح ومتى يتم إرساله. يشار إلى هذا باسم التحكم في الإخراج .

يمكن أن يأتي الإخراج من أي من المصادر التالية:

  • echo، print، printf، print_r... والوظائف والبيانات المماثلة الأخرى
  • الإخطارات والتحذيرات والأخطاء من PHP
  • أي محتوى خارج <?php ?>العلامات

قد تحتفظ PHP والواجهة الخلفية التي تعمل عليها بالمخرجات في مخزن مؤقت قبل إرسالها إلى المستخدم.

ملاحظة: يمكن لوظائف التحكم في الإخراج إنشاء أي عدد من المخازن المؤقتة للإخراج. مخازن الإخراج تلتقط الإخراج الذي قدمه البرنامج. يتم وضع كل مخزن مؤقت للإخراج أعلى كومة من المخازن المؤقتة للإخراج ، وأي إخراج يوفره سيتم التقاطه بواسطة المخزن المؤقت الموجود أسفله. تتعامل وظائف التحكم في الإخراج مع المخزن المؤقت العلوي فقط ، لذلك يجب إزالة المخزن المؤقت العلوي للتحكم في المخازن المؤقتة الموجودة أسفله.

التركيب

تعد وظائف التحكم في الإخراج PHP جزءًا من نواة PHP. لا يلزم التثبيت لاستخدام هذه الوظائف.


تكوين وقت التشغيل

يتأثر سلوك وظائف التحكم في الإخراج بالإعدادات في php.ini:

Name Default Description Version
output_buffering "0" Enables output buffering for all PHP files by default 4
output_handler NULL Set the name of the default function which handles the output of all output buffers 4
implicit_flush "0" Enables implicit flush, which causes output to be sent directly to the browser on each output statement 4
url_rewriter.tags "a=href,area=href, frame=src,form=,fieldset=" Indicates which HTML tags and attributes can be modified by the URL rewriter (the output_add_rewrite_var() function.) 4.3
url_rewriter.hosts The current value of $_SERVER['HTTP_HOST'] URL rewriting is only done on the server's own URLs by default. To allow for rewriting URLs of other websites, set the hostnames of the other websites here. 7.1

وظائف التحكم في إخراج PHP

Method Function
flush() Attempts to send content from the system's output buffer to the browser
ob_clean() Deletes all of the content from the topmost output buffer
ob_end_clean() Deletes the topmost output buffer and all of its contents
ob_end_flush() Deletes the topmost output buffer and outputs its contents
ob_flush() Outputs the contents of the topmost output buffer and clears the buffer
ob_get_clean() Returns all of the contents of the topmost output buffer and clears the buffer
ob_get_contents() Returns the contents of the topmost output buffer
ob_get_flush() Outputs and returns the contents of the topmost output buffer and then deletes the buffer
ob_get_length() Returns the number of bytes of data that are in the topmost output buffer
ob_get_level() Returns a number indicating how many output buffers are on the stack
ob_get_status() Returns information about the output buffers
ob_gzhandler() Used as a callback function for ob_start() to compress the contents of the buffer when sending it to the browser
ob_implicit_flush() Turns implicit flushing on or off
ob_list_handlers() Returns an array of callback function names that are being used by the topmost output buffer
ob_start() Creates a new output buffer and adds it to the top of the stack
output_add_rewrite_var() Used to append query string parameters to any URL in the output
output_reset_rewrite_vars() Removes all variables added by output_add_rewrite_var()