Jump to content

[SOLVED] How to add a charachter to all names


proud

Recommended Posts

If I have the names john richard and jack.. I want them to be written in the formula "john","richard","jack" .. what is the easiest solution to use because I have got hundreds of names on which I want to apply on them the formula I mentioned above and the only thing that separates them is spaces e.g. (john richard jack mark etc..)

even though this is solved, I thought I might add something which could be of use to you later on..

 

<?php
function addQuotes(&$val) {
	$val = "\"".addslashes($val)."\"";
}
$array = array("mark","jack","jimmy","susan");
array_walk($array,"addQuotes");
echo implode(",",$array);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.