如何进行第一次输出 [英] How do I make the 1st output

查看:123
本文介绍了如何进行第一次输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定字符串 -



$ str =aabbcdahhijb;

我们必须这样做字符串到这个 -



output1 = 2a2bcda2hijb

output2 = 3a3bcd2hij

请提供给我的php程序输出。

我已经用给定的代码完成了第二次



我尝试了什么:



given the string-

$str="aabbcdahhijb";
we have to make that string to this-

output1 =2a2bcda2hijb
output2 =3a3bcd2hij
Please provide me the php program for 1st output.
I have done 2nd out by the given code

What I have tried:

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
       $str="aabbcdahhijb";
       echo 'Input: '.$str.'<br>'.'Output: ';
       $a=substr_count($str,'a');
       if($a==1)
           $a='';
       echo $a.'a';
       $a=substr_count($str,'b');
       if($a==1)
           $a='';
       echo $a.'b';
       $a=substr_count($str,'c');
       if($a==1)
           $a='';
       echo $a.'c';
       $a=substr_count($str,'d');
       if($a==1)
           $a='';
       echo $a.'d';
       $a=substr_count($str,'h');
       if($a==1)
           $a='';
       echo $a.'h';
       $a=substr_count($str,'i');
       if($a==1)
           $a='';
       echo $a.'i';
       $a=substr_count($str,'j');
       if($a==1)
           $a='';
       echo $a.'j';
        ?>
    </body>
</html>

推荐答案

str =aabbcdahhijb;

我们必须将该字符串改为此 -



output1 = 2a2bcda2hijb

output2 = 3a3bcd2hij

请为我提供第一个输出的php程序。

我已经用给定代码完成了第二次



我尝试过的事情:



str="aabbcdahhijb";
we have to make that string to this-

output1 =2a2bcda2hijb
output2 =3a3bcd2hij
Please provide me the php program for 1st output.
I have done 2nd out by the given code

What I have tried:

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php


str = aabbcdahhijb;
echo ' 输入:'
str="aabbcdahhijb"; echo 'Input: '.


str。' < br>'' 输出:';
str.'<br>'.'Output: ';


这篇关于如何进行第一次输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆