บทความ

กำลังแสดงโพสต์ที่มีป้ายกำกับ Codeigniter

ฟังก์ชัน fopen()

รูปภาพ
ฟังก์ชัน fopen() สร้างหรือเปิดไฟล์ ด้วยฟังก์ชัน fopen() รูปแบบ         fopen(filename , mode) filename คือ ไฟล์ที่ต้องการทำงาน mode คือ ลักษณะที่จะทำงานกับไฟล์  mode ที่สามารถใส่ได้คือ mode คำอธิบาย r อ่านอย่างเดียว เริ่มต้นที่ต้นไฟล์ r+ อ่านและเขียน เริ่มต้นที่ต้นไฟล์ w เขียนอย่างเดียว โดยเปิดขึ้นมาแล้วลบข้อมูลเก่าทิ้งถ้าไม่มีไฟล์จะสร้างไฟล์ w+ อ่านและเขียน โดยเปิดขึ้นมาแล้วลบข้อมูลเก่าทิ้งถ้าไม่มีไฟล์จะสร้างไฟล์ a เขียนต่อท้าย โดยเปิดขึ้นมาแล้วเขียนต่อท้ายไฟล์ถ้าไม่มีไฟล์จะสร้างไฟล์ a+ อ่านและเขียนต่อท้าย โดยเปิดขึ้นมาแล้วเขียนต่อท้ายไฟล์ ถ้าไม่มีไฟล์จะสร้างไฟล์ x เขียนอย่างเดียว โดยสร้างไฟล์ใหม่ ถ้ามีไฟล์แล้วจะ return error x+ อ่านและเขียน โดยสร้างไฟล์ใหม่ ถ้ามีไฟล์แล้วจะ return error อ่านเพิมเติมได้ที่ http://php.net/manual/en/function.fopen.php ตัวอย่าง <?ph...

Multi-Language implementation in CodeIgniter

รูปภาพ
The Multi-Language feature is necessary for the modern web application. This feature is used for the purpose of internationalization. In this tutorial, we will discuss how to implement the multi-language feature in CodeIgniter framework. Using CodeIgniter’s Language class, you can easily make your site multi-language. CodeIgniter’s Language class provides some functions to retrieve language files and lines of text. The following guides will drive you to the right way for building a multi-language website with CodeIgniter. If you are new to CodeIgniter, you can read  CodeIgniter Tutorial for Beginners  first. Site Default Language Open the  application/config/config.php  file and specify the site’s default language. $config [ 'language' ]  =  'english' ; Creating Language Files Create multiple language files and insert those files into the  application/language/  directory with separate sub-directories for each language (for exam...