在取消数据时,我遇到了错误。有人能告诉我该如何做吗?这是我列出的数组:
enter code here
Array
(
[0] => Id
[1] => Name
[2] => MainDeity
[3] => Description
[4] => MainImage
[5] => Category
[6] => Tehsil
[7] => City
[8] => District
[9] => State
[10] => Terrain
我正在使用laravel框架,想要取消三个列Id、State和Terrain。我已经使用了这段代码,但是它显示错误:Cannot unset string offsets。
enter code here
$columns = Schema::getColumnListing('places');
foreach ($columns as $key => $value) {
if($value=="Id"){
unset($value[$key]);
}
$columndata[] = $value;
}
echo "<pre>";print_r($columndata); die;