小编Việ*_* Lê的帖子

如何在PHP中逐行编写文本文件?

我是PHP的新手.我有一个FORM输入数据,FORM包括3个字段:名称,年龄,地址我想获取提交的数据,并逐行写入文本文件.例如,如果我在FORM上提交3次,我将在下面提供以下文本文件:

john
20
US
Simson
18
UK
Marry
26
Japan

I tried to implement it, but there was always a blank space in the beginning of text file, or there was always a blank space in the end of text file.I could not write file line by line. How do I do that, please help me ?
here is my form :<br>

<form action="themSinhVien.php" method="POST"> 
    <table id="tableHome"> 
        <tr> 
            <td id="td1"> 
                <span> Name: </span>
            </td>
            <td id="td2"> 
                <input type="text" name="name" placeholder="put …
Run Code Online (Sandbox Code Playgroud)

php file

4
推荐指数
1
解决办法
7155
查看次数

如何在 Swift 4.2 中编写键盘通知?

我正在尝试将此代码从 Swift 3 更新到 Swift 4.2

NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidShow), name: .UIKeyboardDidShow, object: nil);
Run Code Online (Sandbox Code Playgroud)

到目前为止,我刚刚尝试了编译器给出的自动更正。这导致如下代码:

NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardDidShow), name: .UIResponder.keyboardDidShowNotification, object: nil);
Run Code Online (Sandbox Code Playgroud)

不幸的是,这并没有让我走多远,导致额外的错误:“没有更多上下文的表达类型是不明确的”
有没有人解决这个问题? 在此处输入图片说明

nsnotificationcenter ios swift swift3 swift4.2

3
推荐指数
1
解决办法
2914
查看次数

标签 统计

file ×1

ios ×1

nsnotificationcenter ×1

php ×1

swift ×1

swift3 ×1

swift4.2 ×1