Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Convert String containing commas to array

$string = "'1', '2', '3'"; 
$string = str_replace("'", '', $string);

$sql = "SELECT * FROM name WHERE id NOT IN ( " . implode(",", explode(',',$string)) . ") LIMIT 10 ";
echo $sql;
Comment

covert strings with commas into arrays

var str = "Rose,Lotus,Sunflower,Marogold,Tulip,Jasmine";
var arr = str.split(',');
console.log(arr);
 
// Output: ["Rose", "Lotus", "Sunflower", "Marogold", "Tulip", "Jasmine"]
Comment

Convert String containing commas to array

SELECT * FROM name WHERE id NOT IN ( 1, 2, 3) LIMIT 10
Comment

Convert String containing commas to array

$string = "'1', '2', '3'"; 
$string = str_replace("'", '', $string);
$sql = "SELECT * FROM name WHERE id NOT IN ( $string ) LIMIT 10 ";
Comment

PREVIOUS NEXT
Code Example
Php :: laravel carbon 
Php :: php server function 
Php :: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file laravel 
Php :: php-curl 
Php :: laravel checking if a record exists 
Php :: wordpress get order 
Php :: get deleted value laravel 
Php :: laravel delete relationship data 
Php :: zero padding php 
Php :: getting input value in session variable in php 
Php :: php interface vs abstract class 
Php :: laravel collection concat 
Php :: str_replace smarty template 
Php :: check null in_array php 
Php :: php echo variable 
Php :: laravel 8 eloquent orderby 
Php :: eloquent all only one culomn 
Php :: use resource in laravel 8 
Php :: how to use php to print inside html 
Php :: array to string using php method 
Php :: wordpress post type template 
Php :: laravel module make migration 
Php :: laravel 8 decimal 
Php :: how to add share icon in wordpress 
Php :: call function in php 
Php :: laravel 9 Route::controller 
Php :: woocommerce get orders by user id 
Php :: eloquent unique combination 
Php :: laravel migration table bigint 
Php :: laravel groupby and latest 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =