问题描述
我有一个文本文件,其中包含1行带有此设置:
- 2222; 3333
由 ;
划分的两个值。
我如何编辑"splitted[0]"
或"splitted[1]"
并将新值保存在文件中?
以下是我到目前为止所拥有的:
<?php
$file_handle = fopen("mytext.txt","rw");
while (!feof($file_handle) )
{
$line_of_text = fgets($file_handle);
$parts = explode("\n",$line_of_text);
foreach ($parts as $str)
{
$str_parts = explode(';',$str); // Split string by ; into an array
array_shift($str_parts); // Remove first element
echo current($str_parts)."\n"; // echo current element and newline
// Same as $str_parts[0]
}
}
fclose($file_handle);
?>
解决方法
getSupportActionBar().show();