30%
return 59 diferents %
one while return 59 diferents %
$row["name_chocolate"] the string return the name of chocolate and % of chocolate
I want to eliminate 30%

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = mysqli_connect("localhost", "root", "P-11fl32fg14", "cocoa");

/*Warning: Undefined array key "type_chocolate" */ 
$Navigationhasbeenclicked= isset($_GET['type_chocolate']);
if($Navigationhasbeenclicked)
{
    $query = "SELECT  chocolate.name_chocolate, type_chocolate.type_chocolate   FROM chocolate 
    INNER JOIN type_chocolate. ON chocolate.id_chocolate =type_chocolate.id_type_chocolate
     WHERE type_chocolate='$_GET[type_chocolate]'";
    $result = mysqli_query($mysqli, $query);

    /* numeric array */
    while ($row = mysqli_fetch_array($result, MYSQLI_BOTH))
    {
        printf("%s %s  \n",  $row["name_chocolate"],$row["type_chocolate"]);?>  <br> 
<?php
    }
}
?>

    Not sure I understand the question (maybe some sample data and desired results would help?), but I think maybe you're looking for something like preg_replace(); e.g.:

    $test = "This is like 93% of stupid examples.";
    echo preg_replace('/\s*\d+%/', '', $test);
    // Ouput:
    // This is like of stupid examples.
    

    Warning: the "regular expression" stuff is like learning another programming language. 😉
    https://www.php.net/manual/en/reference.pcre.pattern.syntax.php

      Write a Reply...