在目标c中是否有一种简单的方法可以将所有特殊字符(如ë,à,é,ä)转换为普通字符,如e en a?
如果我用244替换第一个%s,我得到的总和没有任何问题.但是当在这种情况下使用动态值$ shot时,它似乎没有得到任何东西,我的查询也没有失败,因为其他结果都很好(例如stories.id,stories.title).
$query = sprintf("
SELECT
stories.id,
stories.title,
stories.timestamp,
stories.text,
users.name,
users.avatar,
users.id AS idus,
(SELECT sum(reviews.amount) FROM reviews WHERE reviews.storyid='%s') AS reviews
FROM stories INNER JOIN users ON stories.uid=users.id WHERE stories.id = '%s'",
mysql_real_escape_string($shot),
mysql_real_escape_string($shot));
Run Code Online (Sandbox Code Playgroud)
镜头来自这里:
$shot = $_GET['shot'];
Run Code Online (Sandbox Code Playgroud) 对不起,我是初学者,有人可以帮帮我吗?
<script>
var iW = $(document).width();
$(function() {
//single book
$('#mybook').booklet({
next: '#custom-next',
prev: '#custom-prev',
keyboard: true,
width: return iW, // here is the problem! It doesn't work.
height: 200
});
//multiple books with ID's
$('#mybook1, #mybook2').booklet();
//multiple books with a class
$('.mycustombooks').booklet();
});
</script>
Run Code Online (Sandbox Code Playgroud) 我想做一些非常简单的事情,但是我得到了一个错误,我错过了什么?
int i;
int count;
TutorialAppDelegate *appDelegate = (TutorialAppDelegate *)[[UIApplication sharedApplication] delegate];
Animals *aAnimal = (Animals *)[appDelegate.animals objectAtIndex:i];
count = [animals count];
if (i < count)
{
NSLog(@"%@",aAnimal.animalName);
}
Run Code Online (Sandbox Code Playgroud)
错误:
'*** -[NSMutableArray objectAtIndex:]: index 22510243 beyond bounds [0 .. 5]'
Run Code Online (Sandbox Code Playgroud)
0 ... 5是正确的!数组中只有6个值.
并使用
NSLog(@"%@",aAnimal.animalName);
Run Code Online (Sandbox Code Playgroud)
out函数返回正确的值,当我也将i更改为0时.
有人能帮我吗:
$pattern = "/^(?:[a-zA-Z0-9?. ]?)+@([a-zA-Z0-9]+)(.+)?$/";
$str = "Hey @[14256] hey how are you?";
preg_match($pattern, $title, $matches);
print_r($matches);
Run Code Online (Sandbox Code Playgroud)
如果我删除@提及的括号(@ [14256]),打印结果可以正常工作,但我无法弄清楚如何使用括号来处理正则表达式.所以我将在我的数组中得到结果14256.
objective-c ×2
php ×2
sdk ×2
character ×1
iphone ×1
javascript ×1
jquery ×1
mysql ×1
regex ×1
variables ×1