samedi 9 janvier 2016

php foreach if return same word changes

How can i change foreach if return same word?

I want if return same name change to "name-code" ?

I want if have same product name second product name change to "name-code" for seo url

Thank You

foreach ($xml->product as $product) {
    $code=$product->code;
    $name=$product->name;
    echo $name;
}

Aucun commentaire:

Enregistrer un commentaire