My Table have column, column and column 有列, 列和列
I want insert data before "|" and after "|" on different columns, example i'm input this value to textarea :
1|fuuka-vietsub|https://drive.google.com/file/d/1tDKPbZ_gaNZrcYHt-tQtcF-TH0hMzGFi/view?usp=sharing
Will insert to column , to column and to column 插入列 , 插入列和 to column
I Have this code from index.php :
<form action="api.php" method="post">
<textarea name="themphim" id="themphim"></textarea>
<input type="submit" name="save" value="save"></input>
</form>
File api.php :
<?php
include("db_connect.php");
if(isset($_POST['save']))
{
// Please give for me code
...
//
}
?>
Thanks everybody !
You can use explode
to break using a separator |
$string = '1|fuuka-vietsub|https://drive.google.com/file/d/1tDKPbZ_gaNZrcYHt-tQtcF-TH0hMzGFi/view?usp=sharing';
$strToArray = explode('|',$string);
echo '<pre>';
print_r($strToArray);
Output
Array
(
[0] => 1
[1] => fuuka-vietsub
[2] => https://drive.google.com/file/d/1tDKPbZ_gaNZrcYHt-tQtcF-TH0hMzGFi/view?usp=sharing
)
Now you can use array key 0 -> tap
, 1 -> link
, 2 -> player
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.