PHP - vfprintf 函式



語法

vfprintf(stream,format,argarray)

定義和用法

用於將格式化字串轉換為特定輸出。

返回值

返回生成的字串長度。

引數

序號 引數及描述
1

stream

指定寫入/輸出字串的位置。

2

format

指定字串以及如何格式化其中的變數。

3

argarray

指定一個包含要插入的引數的陣列。

示例

嘗試以下示例

<?php
   $input1 = 123;
   $input2 = 456;
   $file = fopen("sample.txt","r");
   
   vfprintf($file,"%f%f",array($input1,$input2));
?>
php_function_reference.htm
廣告